struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr64718.c
blobac970ec72f3b3c70fe6b981c90bb7d2374bbfe21
1 /*
2 pr64718.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 static int
12 swap (int x)
14 return (unsigned short) ((unsigned short) x << 8 | (unsigned short) x >> 8);
17 static int a = 0x1234;
19 void
20 testTortureExecute (void)
22 int b = 0x1234;
23 if (swap (a) != 0x3412)
24 ASSERT (0);
25 if (swap (b) != 0x3412)
26 ASSERT (0);
27 return;