Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug1409955.c
blob8d07e487c1c06a88e4a1db0bb8a0aa1d4b7cca61
1 /*
2 bug1409955.c
3 */
5 #include <testfwk.h>
7 void
8 WriteToXData (char *buffer)
10 (void)buffer;
13 void
14 test_push_pop (void)
16 char a;
17 __xdata char *p;
18 char d[5];
20 d[0] = 0;
21 d[1] = 0;
22 d[2] = 0;
23 d[3] = 0;
24 d[4] = 0;
25 p = 0;
28 if ((unsigned short)p > 10)
29 a = 10 - (char)p;
30 else
31 a = 60;
32 d[0] = 0x12;
33 d[1] = 0x34;
34 WriteToXData (d); // Watch the xdata: 0, 1!
35 p += a;
36 ASSERT (d[0] == 0x12);
37 ASSERT (d[1] == 0x34);
39 while (!p);
40 d[0] = 1;
41 d[1] = 2;
42 d[2] = 3;
43 d[3] = 4;
44 d[4] = 5;