xref: /llvm-project/clang/test/PCH/bounds-safety-attributed-type.c (revision 3eb9ff30959a670559bcba03d149d4c51bf7c9c9)
1 // RUN: %clang_cc1 -include %S/Inputs/bounds-safety-attributed-type.h -fsyntax-only -verify %s
2 
3 // Test with pch.
4 // RUN: %clang_cc1 -emit-pch -o %t %S/Inputs/bounds-safety-attributed-type.h
5 // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
6 // RUN: %clang_cc1 -include-pch %t -ast-print %s | FileCheck %s --check-prefix PRINT
7 // RUN: %clang_cc1 -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix DUMP
8 // expected-no-diagnostics
9 
10 // PRINT: 	   struct Test {
11 // PRINT-NEXT:   int count;
12 // PRINT-NEXT:   int fam[] __counted_by(count);
13 // PRINT-NEXT: };
14 
15 // DUMP:        RecordDecl {{.*}} imported <undeserialized declarations> struct Test definition
16 // DUMP-NEXT:   |-FieldDecl {{.*}} imported referenced count 'int'
17 // DUMP-NEXT:   `-FieldDecl {{.*}} imported fam 'int[] __counted_by(count)':'int[]'
18