struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr87290.c
blob233d685f8cbd097a9e4c3185bda736bf3fcfc16b
1 /*
2 pr87290.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* PR middle-end/87290 */
9 int c;
11 void
12 f0 (void)
14 c++;
17 int
18 f1 (int x)
20 return x % 16 == 13;
23 int
24 f2 (int x)
26 return x % 16 == -13;
29 void
30 f3 (int x)
32 if (x % 16 == 13)
33 f0 ();
36 void
37 f4 (int x)
39 if (x % 16 == -13)
40 f0 ();
43 void
44 testTortureExecute (void)
46 int i, j;
47 for (i = -30; i < 30; i++)
49 if (f1 (13 + i * 16) != (i >= 0) || f2 (-13 + i * 16) != (i <= 0))
50 ASSERT (0);
51 f3 (13 + i * 16);
52 if (c != (i >= 0))
53 ASSERT (0);
54 f4 (-13 + i * 16);
55 if (c != 1 + (i == 0))
56 ASSERT (0);
57 for (j = 1; j < 16; j++)
59 if (f1 (13 + i * 16 + j) || f2 (-13 + i * 16 + j))
60 ASSERT (0);
61 f3 (13 + i * 16 + j);
62 f4 (-13 + i * 16 + j);
64 if (c != 1 + (i == 0))
65 ASSERT (0);
66 c = 0;
68 return;