struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20140622-1.c
blobee72cc2ebde905aa598f23a6c5fd88d752801ecd
1 /*
2 20140622-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 unsigned p;
13 long
14 test (unsigned a)
16 return (long)(p + a) - (long)p;
19 void
20 testTortureExecute (void)
22 p = (unsigned) -2;
23 if (test (0) != 0)
24 ASSERT (0);
25 if (test (1) != 1)
26 ASSERT (0);
27 if (test (2) != -(long)(unsigned)-2)
28 ASSERT (0);
29 p = (unsigned) -1;
30 if (test (0) != 0)
31 ASSERT (0);
32 if (test (1) != -(long)(unsigned)-1)
33 ASSERT (0);
34 if (test (2) != -(long)(unsigned)-2)
35 ASSERT (0);