Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-930529-1.c
blob6f6b912bb6032c12d8668182a5b3bd7078d7faff
1 /*
2 930529-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 int dd (int x, int d) { return x / d; }
13 void
14 testTortureExecute (void)
16 #ifndef PORT_HOST // Hangs on Debian GNU/Linux with GCC 7.2.0
17 int i;
18 for (i = -3; i <= 3; i++)
20 if (dd (i, 1) != i / 1)
21 ASSERT (0);
22 if (dd (i, 2) != i / 2)
23 ASSERT (0);
24 if (dd (i, 3) != i / 3)
25 ASSERT (0);
26 if (dd (i, 4) != i / 4)
27 ASSERT (0);
28 if (dd (i, 5) != i / 5)
29 ASSERT (0);
30 if (dd (i, 6) != i / 6)
31 ASSERT (0);
32 if (dd (i, 7) != i / 7)
33 ASSERT (0);
34 if (dd (i, 8) != i / 8)
35 ASSERT (0);
37 for (i = ((unsigned) ~0 >> 1) - 3; i <= ((unsigned) ~0 >> 1) + 3; i++)
39 if (dd (i, 1) != i / 1)
40 ASSERT (0);
41 if (dd (i, 2) != i / 2)
42 ASSERT (0);
43 if (dd (i, 3) != i / 3)
44 ASSERT (0);
45 if (dd (i, 4) != i / 4)
46 ASSERT (0);
47 if (dd (i, 5) != i / 5)
48 ASSERT (0);
49 if (dd (i, 6) != i / 6)
50 ASSERT (0);
51 if (dd (i, 7) != i / 7)
52 ASSERT (0);
53 if (dd (i, 8) != i / 8)
54 ASSERT (0);
56 return;
57 #endif