brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 0aa2f16 Raw
28 lines · c
1// RUN: rm -rf %t2// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -verify %s3// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -ast-dump-all %s | FileCheck %s4// expected-no-diagnostics5 6#pragma clang module build bounds_safety7module bounds_safety {}8#pragma clang module contents9#pragma clang module begin bounds_safety10struct Test {11  int count;12  int fam[] __attribute__((counted_by(count)));13};14#pragma clang module end15#pragma clang module endbuild16 17#pragma clang module import bounds_safety18 19struct Test *p;20 21// CHECK: |-RecordDecl {{.*}}bounds_safety.map:4:1, line:7:1> line:4:8 imported in bounds_safety <undeserialized declarations> struct Test definition22// CHECK: | |-FieldDecl {{.*}} imported in bounds_safety referenced count 'int'23// CHECK: | `-FieldDecl {{.*}} imported in bounds_safety fam 'int[] __counted_by(count)':'int[]'24 25// CHECK: |-ImportDecl {{.*}}bounds-safety-attributed-type.c:17:22> col:22 implicit bounds_safety26// CHECK: |-RecordDecl {{.*}} struct Test27// CHECK: `-VarDecl {{.*}} p 'struct Test *'28