Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Sema / bpf-attr-preserve-static-offset.c
blobf1519a3f1f3c4c1ef44da6f6cea081d0184d2b22
1 // RUN: %clang_cc1 -ast-dump -triple bpf-pc-linux-gnu %s | FileCheck %s
3 // The 'preserve_static_offset' attribute should be propagated to
4 // inline declarations (foo's 'b', 'bb', 'c' but not 'd').
5 //
6 // CHECK: RecordDecl {{.*}} struct foo definition
7 // CHECK-NEXT: BPFPreserveStaticOffsetAttr
8 // CHECK-NEXT: FieldDecl {{.*}} a
9 // CHECK-NEXT: RecordDecl {{.*}} struct definition
10 // CHECK-NEXT: FieldDecl {{.*}} aa
11 // CHECK-NEXT: FieldDecl {{.*}} b
12 // CHECK-NEXT: RecordDecl {{.*}} union bar definition
13 // CHECK-NEXT: BPFPreserveStaticOffsetAttr
14 // CHECK-NEXT: FieldDecl {{.*}} a
15 // CHECK-NEXT: FieldDecl {{.*}} b
17 struct foo {
18 int a;
19 struct {
20 int aa;
21 } b;
22 } __attribute__((preserve_static_offset));
24 union bar {
25 int a;
26 long b;
27 } __attribute__((preserve_static_offset));