struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-990531-1.c
bloba050e0b56378213b3a035f4b7a8030cee9549d91
1 /*
2 990531-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 unsigned long bad(int reg, unsigned long inWord)
13 union {
14 unsigned long word;
15 unsigned char byte[4];
16 } data;
18 data.word = inWord;
19 data.byte[reg] = 0;
21 return data.word;
24 void
25 testTortureExecute (void)
27 /* XXX This test could be generalized. */
28 if (sizeof (long) != 4)
29 return;
31 if (bad (0, 0xdeadbeef) == 0xdeadbeef)
32 ASSERT (0);
33 return;