struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-1953.c
blob281b9ba84c76fa7b724a005a1155b6f1f95f05c4
1 /*
2 bug-1953.c
3 */
5 #include <testfwk.h>
6 #include <string.h>
8 char pat[8] = {'S', 'D', 'C', 'C', 0, 1, 0, 0};
9 char str_p0[8] = "SDCC\x00\x01";
10 char str_p1[8] = {'S', 'D', 'C', 'C', 0, 1};
12 void testBug(void)
14 char str_l0[8] = "SDCC\x00\x01";
15 #ifndef __SDCC_pdk14 // Not enough RAM
16 char str_l1[8] = {'S', 'D', 'C', 'C', 0, 1};
17 static char str_s0[8] = "SDCC\x00\x01";
18 static char str_s1[8] = {'S', 'D', 'C', 'C', 0, 1};
19 #endif
21 ASSERT (memcmp (str_p0, pat, sizeof (pat)) == 0);
22 ASSERT (memcmp (str_p1, pat, sizeof (pat)) == 0);
23 ASSERT (memcmp (str_l0, pat, sizeof (pat)) == 0);
24 #ifndef __SDCC_pdk14 // Not enough RAM
25 ASSERT (memcmp (str_l1, pat, sizeof (pat)) == 0);
26 ASSERT (memcmp (str_s0, pat, sizeof (pat)) == 0);
27 ASSERT (memcmp (str_s1, pat, sizeof (pat)) == 0);
28 #endif