[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / PCH / bounds-safety-attributed-type.c
blobc2dc0272bbd6059244e6f68784889cd16cc030ab
1 // RUN: %clang_cc1 -include %S/Inputs/bounds-safety-attributed-type.h -fsyntax-only -verify %s
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
10 // PRINT: struct Test {
11 // PRINT-NEXT: int count;
12 // PRINT-NEXT: int fam[] __counted_by(count);
13 // PRINT-NEXT: };
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[]'