| 1 |
/* Test BTF generation for struct with 0 size bitfield. |
| 2 |
|
| 3 |
We expect a struct with 2 members to be generated. The size 0 bitfield |
| 4 |
should not have any entry in the member list. */ |
| 5 |
|
| 6 |
/* { dg-do compile } */ |
| 7 |
/* { dg-options "-O0 -gbtf -dA" } */ |
| 8 |
|
| 9 |
/* Struct with bitfield members, and 2 members. */ |
| 10 |
/* { dg-final { scan-assembler-times "\[\t \]0x84000002\[\t \]+\[^\n\]*btt_info" 1 } } */ |
| 11 |
|
| 12 |
/* Bitfield size 31 (0x1f) at offset 0. */ |
| 13 |
/* { dg-final { scan-assembler-times "\[\t \]0x1f000000\[\t \]+\[^\n\]*btm_offset" 1 } } */ |
| 14 |
|
| 15 |
/* Bitfield size 32 (0x20) at offset 32. */ |
| 16 |
/* { dg-final { scan-assembler-times "\[\t \]0x20000020\[\t \]+\[^\n\]*btm_offset" 1 } } */ |
| 17 |
|
| 18 |
/* Only 2 members. */ |
| 19 |
/* { dg-final { scan-assembler-times "MEMBER" 2 } } */ |
| 20 |
|
| 21 |
#if __SIZEOF_INT__ < 4 |
| 22 |
#define unsigned __UINT32_TYPE__ |
| 23 |
#endif |
| 24 |
|
| 25 |
struct foo |
| 26 |
{ |
| 27 |
unsigned a : 31; |
| 28 |
unsigned : 0; |
| 29 |
unsigned c : 32; |
| 30 |
} myfoo; |