gcc/testsuite/gcc.c-torture/execute/961122-1.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | long long acc; |
| 5 | |
| 6 | void |
| 7 | addhi (short a) |
| 8 | { |
| 9 | acc += (long long) a << 32; |
| 10 | } |
| 11 | |
| 12 | void |
| 13 | subhi (short a) |
| 14 | { |
| 15 | acc -= (long long) a << 32; |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main (void) |
| 20 | { |
| 21 | acc = 0xffff00000000ll; |
| 22 | addhi (1); |
| 23 | if (acc != 0x1000000000000ll) |
| 24 | abort (); |
| 25 | subhi (1); |
| 26 | if (acc != 0xffff00000000ll) |
| 27 | abort (); |
| 28 | exit (0); |
| 29 | } |