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-20000801-1.c
blob421d053354cb74f4e1c6fcca2439a4fb105d0bf5
1 /*
2 20000801-1.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 void
12 foo (char *bp, unsigned n)
14 register char c;
15 register char *ep = bp + n;
16 register char *sp;
18 while (bp < ep)
20 sp = bp + 3;
21 c = *sp;
22 *sp = *bp;
23 *bp++ = c;
24 sp = bp + 1;
25 c = *sp;
26 *sp = *bp;
27 *bp++ = c;
28 bp += 2;
32 void
33 testTortureExecute (void)
35 int one = 1;
37 if (sizeof(int) != 4 * sizeof(char))
38 return;
40 foo ((char *)&one, sizeof(one));
41 foo ((char *)&one, sizeof(one));
43 if (one != 1)
44 ASSERT (0);
46 return;