struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr49161.c
blobf6b152899f39e5a568cce382d43e72a27e08e018
1 /*
2 pr49161.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/49161 */
13 int c;
15 void
16 bar (int x)
18 if (x != c++)
19 ASSERT (0);
22 void
23 foo (int x)
25 switch (x)
27 case 3: goto l1;
28 case 4: goto l2;
29 case 6: goto l3;
30 default: return;
32 l1:
33 goto l4;
34 l2:
35 goto l4;
36 l3:
37 bar (-1);
38 l4:
39 bar (0);
40 if (x != 4)
41 bar (1);
42 if (x != 3)
43 bar (-1);
44 bar (2);
47 void
48 testTortureExecute (void)
50 #if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5))
51 foo (3);
52 if (c != 3)
53 ASSERT (0);
54 return;
55 #endif