struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr24141.c
bloba36e66e4df7477c46d1ce311c332643050d2fdc3
1 /*
2 pr24141.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 // reduced testcase, compile with -O2. Also, with --disable-checking
12 // gcc produces wrong code.
14 int i;
16 void g (void)
18 i = 1;
21 void f (int a, int b)
23 int c = 0;
24 if (a == 0)
25 c = 1;
26 if (c)
27 return;
28 if (c == 1)
29 c = 0;
30 if (b == 0)
31 c = 1;
32 if (c)
33 g ();
36 void
37 testTortureExecute (void)
39 f (1, 0);
40 if (i != 1)
41 ASSERT (0);
42 return;