gcc/testsuite/gcc.c-torture/execute/strct-pack-1.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | typedef struct |
| 5 | { |
| 6 | short s __attribute__ ((aligned(2), packed)); |
| 7 | double d __attribute__ ((aligned(2), packed)); |
| 8 | } TRIAL; |
| 9 | |
| 10 | int |
| 11 | check (TRIAL *t) |
| 12 | { |
| 13 | if (t->s != 1 || t->d != 16.0) |
| 14 | return 1; |
| 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main (void) |
| 20 | { |
| 21 | TRIAL trial; |
| 22 | |
| 23 | trial.s = 1; |
| 24 | trial.d = 16.0; |
| 25 | |
| 26 | if (check (&trial) != 0) |
| 27 | abort (); |
| 28 | exit (0); |
| 29 | } |