| 1 |
// RUN: c-index-test -test-print-type-size %s -target x86_64-pc-linux-gnu | FileCheck %s |
| 2 |
|
| 3 |
struct Foo { |
| 4 |
int size; |
| 5 |
// CHECK: FieldDecl=size:4:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=0] |
| 6 |
void *data[]; |
| 7 |
// CHECK: FieldDecl=data:6:9 (Definition) [type=void *[]] [typekind=IncompleteArray] [sizeof=-2] [alignof=8] [offsetof=64] |
| 8 |
}; |
| 9 |
|
| 10 |
struct Bar { |
| 11 |
int size; |
| 12 |
// CHECK: FieldDecl=size:11:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=0] |
| 13 |
struct { |
| 14 |
int dummy; |
| 15 |
// CHECK: FieldDecl=dummy:14:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=64/0] |
| 16 |
void *data[]; |
| 17 |
// CHECK: FieldDecl=data:16:11 (Definition) [type=void *[]] [typekind=IncompleteArray] [sizeof=-2] [alignof=8] [offsetof=128/64] |
| 18 |
}; |
| 19 |
}; |
| 20 |
|
| 21 |
struct Baz { |
| 22 |
int size; |
| 23 |
// CHECK: FieldDecl=size:22:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=0] |
| 24 |
union { |
| 25 |
void *data1[]; |
| 26 |
// CHECK: FieldDecl=data1:25:11 (Definition) [type=void *[]] [typekind=IncompleteArray] [sizeof=-2] [alignof=8] [offsetof=64/0] |
| 27 |
void *data2[]; |
| 28 |
// CHECK: FieldDecl=data2:27:11 (Definition) [type=void *[]] [typekind=IncompleteArray] [sizeof=-2] [alignof=8] [offsetof=64/0] |
| 29 |
}; |
| 30 |
}; |
| 31 |
|