struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr78720.c
blob430934f228c603538cd4bd5878250d8e1f7d89e1
1 /*
2 pr78720.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 /* PR tree-optimization/78720 */
13 long int
14 foo (signed char x)
16 return x < 0 ? 0x80000L : 0L;
19 long int
20 bar (signed char x)
22 return x < 0 ? 0x80L : 0L;
25 long int
26 baz (signed char x)
28 return x < 0 ? 0x20L : 0L;
31 void
32 testTortureExecute (void)
34 if (foo (-1) != 0x80000L || bar (-1) != 0x80L || baz (-1) != 0x20L
35 || foo (0) != 0L || bar (0) != 0L || baz (0) != 0L
36 || foo (31) != 0L || bar (31) != 0L || baz (31) != 0L)
37 ASSERT (0);
38 return;