1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
long long acc; addhi (short a) { acc += (long long) a << 32; } subhi (short a) { acc -= (long long) a << 32; } main () { acc = 0xffff00000000ll; addhi (1); if (acc != 0x1000000000000ll) abort (); subhi (1); if (acc != 0xffff00000000ll) abort (); exit (0); }