struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2384.c
blob7716c4a5067eb123d77ff6d91762874056e62107
1 /*
2 bug-2384.c
3 */
5 #include <testfwk.h>
7 typedef char chararr[4];
9 const char a[4] = {'1', '2', '3', '4'};
10 const chararr b = {'5', '6', '7', '8'};
11 const char c[4] = {'a', 'b', 'c', 'd'};
13 void testBug (void)
15 #if defined (__SDCC)
16 const char *pa = a, *pb = b, *pc = c;
17 #if !defined(__SDCC_pic14) // Linker changes data order
18 ASSERT (pa[4] == '5');
19 ASSERT (pb[-1] == '4');
20 ASSERT (pb[4] == 'a');
21 ASSERT (pc[-1] == '8');
22 #endif
23 #endif