gcc/testsuite/gcc.c-torture/execute/20010904-2.c
raw| 1 | /* If some target has a Max alignment less than 32, please create |
| 2 | a #ifdef around the alignment and add your alignment. */ |
| 3 | #ifdef __pdp11__ |
| 4 | #define alignment 2 |
| 5 | #else |
| 6 | #define alignment 32 |
| 7 | #endif |
| 8 | |
| 9 | void abort (void); |
| 10 | void exit (int); |
| 11 | |
| 12 | typedef struct x { int a; int b; } __attribute__((aligned(alignment))) X; |
| 13 | typedef struct y { X x; X y[31]; int c; } Y; |
| 14 | |
| 15 | Y y[2]; |
| 16 | |
| 17 | int main(void) |
| 18 | { |
| 19 | if (((char *)&y[1] - (char *)&y[0]) & 31) |
| 20 | abort (); |
| 21 | exit (0); |
| 22 | } |