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-pr27073.c
blob35c9db438114549e746591b595d2ce49c19cc02c
1 /*
2 pr27073.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 85
10 #endif
12 #if !defined (__SDCC_pdk14) && !defined (__SDCC_pic14) // Lack of memory
13 void
14 foo (int *p, int d1, int d2, int d3,
15 short count, int s1, int s2, int s3, int s4, int s5)
17 int n = count;
18 while (n--)
20 *p++ = s1;
21 *p++ = s2;
22 *p++ = s3;
23 *p++ = s4;
24 *p++ = s5;
27 #endif
29 void
30 testTortureExecute (void)
32 #if !defined (__SDCC_pdk14) && !defined (__SDCC_pic14) // Lack of memory
33 int x[10], i;
35 foo (x, 0, 0, 0, 2, 100, 200, 300, 400, 500);
36 for (i = 0; i < 10; i++)
37 if (x[i] != (i % 5 + 1) * 100)
38 ASSERT (0);
39 return;
40 #endif