struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20020216-1.c
blobbc766dadbfdb87180d23c5da2f9ea327590ab00d
1 /*
2 20020216-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 /* PR c/3444
12 This used to fail because bitwise xor was improperly computed in char type
13 and sign extended to int type. */
15 signed char c = (signed char) 0xffffffff;
17 int foo (void)
19 return (unsigned short) c ^ (signed char) 0x99999999;
22 void testTortureExecute (void)
24 if ((unsigned char) -1 != 0xff
25 || sizeof (short) != 2
26 || sizeof (int) != 4)
27 return;
28 if (foo () != (int) 0xffff0066)
29 ASSERT (0);
30 return;