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-pr27260.c
blob6a0688d2358a8645cb335691097fd56c8f306551
1 /*
2 pr15262.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 /* PR middle-end/27260 */
13 #include <string.h>
15 #if !defined (__SDCC_pdk14) // Lack of memory
16 char buf[65];
18 void
19 foo (int x)
21 memset (buf, x != 2 ? 1 : 0, 64);
23 #endif
25 void
26 testTortureExecute (void)
28 #if !defined (__SDCC_pdk14) // Lack of memory
29 int i;
30 buf[64] = 2;
31 for (i = 0; i < 64; i++)
32 if (buf[i] != 0)
33 ASSERT (0);
34 foo (0);
35 for (i = 0; i < 64; i++)
36 if (buf[i] != 1)
37 ASSERT (0);
38 foo (2);
39 for (i = 0; i < 64; i++)
40 if (buf[i] != 0)
41 ASSERT (0);
42 if (buf[64] != 2)
43 ASSERT (0);
44 return;
45 #endif