Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-2427.c
bloba283e4356b1c2dcb5a98f365e46dfba0165e732c
1 /*
2 bug-2427.c
3 */
5 #include <testfwk.h>
6 #include <string.h>
8 static char b0[10] = "1\0002\0003";
9 static char c0[10] = {'1', 0, '2', 0, '3', 0, 0, 0, 0, 0};
11 static char foo (char a)
13 return a + 1;
16 #ifndef __SDCC_pdk14 // Lack of memory
17 static char b1[15] = "A\000B\000C";
18 static char c1[15] = {'A', 0, 'B', 0, 'C', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
19 #endif
21 void testBug (void)
23 #ifndef __SDCC_pdk14 // Lack of memory
24 ASSERT (memcmp (b0, c0, sizeof (c0)) == 0);
25 ASSERT (memcmp (b1, c1, sizeof (c1)) == 0);
26 ASSERT (foo ('a') == 'b');
27 #endif