struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20030120-1.c
blobd9b0882ae86b330ec340e2364c9890cc8f2f2175
1 /*
2 20030120-1.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 /* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final
12 pass to remove test insns that should be kept. */
14 unsigned short
15 t1 (unsigned short w)
17 if ((w & 0xff00) == 0)
19 if (w == 0)
20 w = 2;
22 return w;
25 unsigned long
26 t2 (unsigned long w)
28 if ((w & 0xffff0000) == 0)
30 if (w == 0)
31 w = 2;
33 return w;
36 int
37 t3 (unsigned short a)
39 if (a & 1)
40 return 1;
41 else if (a)
42 return 1;
43 else
44 return 0;
47 void
48 testTortureExecute (void)
50 if (t1 (1) != 1)
51 ASSERT (0);
53 if (t2 (1) != 1)
54 ASSERT (0);
56 if (t3 (2) != 1)
57 ASSERT (0);
59 return;