| 1 |
/* Test BTF generation for non-representable bitfields. |
| 2 |
|
| 3 |
Due to the limitations of BTF, we only have 24 bits in which to store |
| 4 |
the bitfield offset (in bits, from the beginning of the struct). |
| 5 |
|
| 6 |
In this test, we construct a structure such that the bitfield will have |
| 7 |
an offset so large as to be unrepresentable in BTF. We expect that the |
| 8 |
resulting BTF will describe the rest of the structure, ignoring the |
| 9 |
non-representable bitfield by simply using void data type for the same. */ |
| 10 |
|
| 11 |
/* { dg-do compile } */ |
| 12 |
/* { dg-options "-O0 -gbtf -dA" } */ |
| 13 |
/* { dg-require-effective-target size32plus } */ |
| 14 |
|
| 15 |
/* Struct with 4 members and no bitfield (kind_flag not set). */ |
| 16 |
/* { dg-final { scan-assembler-times "\[\t \]0x4000004\[\t \]+\[^\n\]*btt_info" 1 } } */ |
| 17 |
/* { dg-final { scan-assembler-times " MEMBER" 4 } } */ |
| 18 |
/* { dg-final { scan-assembler-times " MEMBER 'unsup' idx=2\[\\r\\n\]+\[^\\r\\n\]*0\[\t \]+\[^\n\]*btm_type: void" 1 } } */ |
| 19 |
|
| 20 |
struct bigly |
| 21 |
{ |
| 22 |
int a; |
| 23 |
int b[((0xffffff + 1) / (8 * sizeof (int)))]; |
| 24 |
unsigned unsup : 7; |
| 25 |
char c; |
| 26 |
} big; |