gcc/testsuite/gcc.c-torture/execute/930930-2.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | int |
| 5 | test_endianness() |
| 6 | { |
| 7 | union doubleword |
| 8 | { |
| 9 | double d; |
| 10 | unsigned long u[2]; |
| 11 | } dw; |
| 12 | dw.d = 10; |
| 13 | return dw.u[0] != 0 ? 1 : 0; |
| 14 | } |
| 15 | |
| 16 | int |
| 17 | test_endianness_vol() |
| 18 | { |
| 19 | union doubleword |
| 20 | { |
| 21 | volatile double d; |
| 22 | volatile long u[2]; |
| 23 | } dw; |
| 24 | dw.d = 10; |
| 25 | return dw.u[0] != 0 ? 1 : 0; |
| 26 | } |
| 27 | |
| 28 | int |
| 29 | main (void) |
| 30 | { |
| 31 | if (test_endianness () != test_endianness_vol ()) |
| 32 | abort (); |
| 33 | exit (0); |
| 34 | } |