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-20051110-1.c
blob72fe253a1329ad8e80fb169dbe6798588233b446
1 /*
2 20051110-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 void add_unwind_adjustsp (long);
13 unsigned char bytes[5];
15 void
16 add_unwind_adjustsp (long offset)
18 int n;
19 unsigned long o;
21 o = (long) ((offset - 0x204) >> 2);
23 n = 0;
24 while (o)
26 bytes[n] = o & 0x7f;
27 o >>= 7;
28 if (o)
29 bytes[n] |= 0x80;
30 n++;
34 void testTortureExecute(void)
36 add_unwind_adjustsp (4132);
37 if (bytes[0] != 0x88 || bytes[1] != 0x07)
38 ASSERT (0);
39 return;