struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20060102-1.c
blobb9cca9f007d6c43e147978dc0ea17f33644f4a35
1 /*
2 20060102-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 #include <limits.h>
13 int f(int x)
15 return (x >> (sizeof (x) * CHAR_BIT - 1)) ? -1 : 1;
18 volatile int one = 1;
19 void testTortureExecute (void)
21 /* Test that the function above returns different values for
22 different signs. */
23 if (f(one) == f(-one))
24 ASSERT (0);
25 return;