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-pr80501.c
blobddb670e07f21e392dfe7141df83d71ee1918f9ff
1 /*
2 pr80501.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 #include <limits.h>
13 /* PR rtl-optimization/80501 */
15 signed char v = 0;
17 static signed char
18 foo (int x, int y)
20 return x << y;
23 int
24 bar (void)
26 return foo (v >= 0, CHAR_BIT - 1) >= 1;
29 void
30 testTortureExecute (void)
32 #if !(defined (__GNUC__) && (__GNUC__ < 7))
33 if (sizeof (int) > sizeof (char) && bar () != 0)
34 ASSERT (0);
35 return;
36 #endif