struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20060110-volatile.c
blobe4f3c9f47eddfc85ee2e408b6492d8b50f6a8dbc
1 /*
2 Modified 20060110-?.c from the execute part of the gcc torture suite.
3 Volatile input to trigger some peephole rules for STM8
4 */
6 #include <testfwk.h>
8 #ifdef __SDCC
9 #pragma std_c99
10 #endif
12 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14) // Lack of memory
13 long long
14 f (volatile long long a, volatile long long b)
16 return ((a + b) << 32) >> 32;
19 long long a = 0x1234567876543210LL;
20 long long b = 0x2345678765432101LL;
21 long long c = ((0x1234567876543210LL + 0x2345678765432101LL) << 32) >> 32;
22 #endif
24 void
25 testTortureExecute (void)
27 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14) // Lack of memory
28 ASSERT (f (a, b) == c);
29 return;
30 #endif