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-pr77718.c
blob6fa8268583c66d605c994b1a44eed50483d21fa4
1 /*
2 pr77718.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 <string.h>
13 /* PR middle-end/77718 */
15 #if !defined(__SDCC_pdk14) // Lack of memory
16 char a[64];
18 int
19 foo (void)
21 return memcmp ("bbbbbb", a, 6);
24 int
25 bar (void)
27 return memcmp (a, "bbbbbb", 6);
29 #endif
31 void
32 testTortureExecute (void)
34 #if !defined(__SDCC_pdk14) // Lack of memory
35 memset (a, 'a', sizeof (a));
36 if (((foo () < 0) ^ ('a' > 'b'))
37 || ((bar () < 0) ^ ('a' < 'b')))
38 ASSERT (0);
39 return;
40 #endif