gcc/testsuite/gcc.c-torture/execute/990531-1.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | unsigned long bad(int reg, unsigned long inWord) |
| 5 | { |
| 6 | union { |
| 7 | unsigned long word; |
| 8 | unsigned char byte[4]; |
| 9 | } data; |
| 10 | |
| 11 | data.word = inWord; |
| 12 | data.byte[reg] = 0; |
| 13 | |
| 14 | return data.word; |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | main(void) |
| 19 | { |
| 20 | /* XXX This test could be generalized. */ |
| 21 | if (sizeof (long) != 4) |
| 22 | exit (0); |
| 23 | |
| 24 | if (bad (0, 0xdeadbeef) == 0xdeadbeef) |
| 25 | abort (); |
| 26 | exit (0); |
| 27 | } |