struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20040309-1.c
blob675623fe096b3d324792c1fe00cdb60b6d16da5d
1 /*
2 20040309-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 int foo(unsigned short x)
13 unsigned short y;
14 y = x > 32767 ? x - 32768 : 0;
15 return y;
18 void
19 testTortureExecute (void)
21 if (foo (0) != 0)
22 ASSERT (0);
23 if (foo (32767) != 0)
24 ASSERT (0);
25 if (foo (32768) != 0)
26 ASSERT (0);
27 if (foo (32769) != 1)
28 ASSERT (0);
29 if (foo (65535) != 32767)
30 ASSERT (0);
31 return;