gcc/testsuite/gcc.c-torture/execute/packed-aligned.c
raw| 1 | struct c { |
| 2 | double a; |
| 3 | } __attribute((packed)) __attribute((aligned)); |
| 4 | |
| 5 | extern void abort(void); |
| 6 | |
| 7 | double g_expect = 32.25; |
| 8 | |
| 9 | void f(unsigned x, struct c y) |
| 10 | { |
| 11 | if (x != 0) |
| 12 | abort(); |
| 13 | |
| 14 | if (y.a != g_expect) |
| 15 | abort(); |
| 16 | } |
| 17 | |
| 18 | struct c e = { 64.25 }; |
| 19 | |
| 20 | int main(void) |
| 21 | { |
| 22 | struct c d = { 32.25 }; |
| 23 | f(0, d); |
| 24 | |
| 25 | g_expect = 64.25; |
| 26 | f(0, e); |
| 27 | return 0; |
| 28 | } |