| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Wpadded" } */ |
| 3 |
|
| 4 |
/* |
| 5 |
* The struct is on single line, because C++ compiler emits the -Wpadded |
| 6 |
* warning at the first line of the struct definition, while the C compiler at |
| 7 |
* the last line. This way the test passes on both. |
| 8 |
* |
| 9 |
* Attribute aligned is needed for the test to pass on targets where |
| 10 |
* the default behaviour is to pack the struct and also on targets that align |
| 11 |
* 4 byte fields to 2 byte boundary. |
| 12 |
*/ |
| 13 |
struct S { __UINT32_TYPE__ i; char c; } __attribute__((aligned(4))); /* { dg-warning "padding struct size to alignment boundary with 3 bytes" } */ |
| 14 |
|