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-20170419-1.c
blobb15295482963fae7dab1cbbdef7b22c9d2ea7852
1 /*
2 20170419-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 /* PR tree-optimization/80426 */
12 /* Testcase by <ishiura-compiler@ml.kwansei.ac.jp> */
14 #define INT_MAX 0x7fffffff
15 #define INT_MIN (-INT_MAX-1)
17 int x;
19 void
20 testTortureExecute (void)
22 volatile int a = 0;
23 volatile int b = -INT_MAX;
24 int j;
26 for(j = 0; j < 18; j += 1) {
27 x = ( (a == 0) != (b - (int)(INT_MIN) ) );
30 if (x != 0)
31 ASSERT (0);