brintos

brintos / llvm-project-archived public Read only

0
0
Text · 807 B · f1519a3 Raw
28 lines · c
1// RUN: %clang_cc1 -ast-dump -triple bpf-pc-linux-gnu %s | FileCheck %s2 3// The 'preserve_static_offset' attribute should be propagated to4// inline declarations (foo's 'b', 'bb', 'c' but not 'd').5//6// CHECK:      RecordDecl {{.*}} struct foo definition7// CHECK-NEXT:   BPFPreserveStaticOffsetAttr8// CHECK-NEXT:   FieldDecl {{.*}} a9// CHECK-NEXT:   RecordDecl {{.*}} struct definition10// CHECK-NEXT:     FieldDecl {{.*}} aa11// CHECK-NEXT:   FieldDecl {{.*}} b12// CHECK-NEXT: RecordDecl {{.*}} union bar definition13// CHECK-NEXT:   BPFPreserveStaticOffsetAttr14// CHECK-NEXT:   FieldDecl {{.*}} a15// CHECK-NEXT:   FieldDecl {{.*}} b16 17struct foo {18  int a;19  struct {20    int aa;21  } b;22} __attribute__((preserve_static_offset));23 24union bar {25  int a;26  long b;27} __attribute__((preserve_static_offset));28