struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20010717-1.c
blobcfa996c19abc60b3cc9a5bfce6bca4c64abc1d0c
1 /*
2 20010717-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 void
12 testTortureExecute (void)
14 int i, j;
15 unsigned long u, r1, r2;
17 i = -16;
18 j = 1;
19 u = i + j;
21 /* no sign extension upon shift */
22 r1 = u >> 1;
23 /* sign extension upon shift, but there shouldn't be */
24 r2 = ((unsigned long) (i + j)) >> 1;
26 if (r1 != r2)
27 ASSERT (0);
29 return;