Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-2601.c.in
blobf17f9ee17ecc949e7f58f6e64af329d48e03e7c9
1 /*
2 bug-2601.c
3 mem: __idata, __xdata,
4 */
6 #include <testfwk.h>
8 unsigned char {mem} *p;
9 unsigned char {mem} *a;
10 signed char b;
12 void f(void)
14 p = a + b;
17 void g(void)
19 p = b + a;
22 unsigned char {mem} c[2] = {23, 42};
24 void testBug(void)
26 a = c + 1;
27 b = -1;
29 p = 0;
30 f();
31 ASSERT(*p == 23);
33 p = 0;
34 g();
35 ASSERT(*p == 23);