exclude z80 and gbz80
[fw/sdcc] / support / regression / tests / zeropad.c
1 /** Zeropad tests.
2
3     storage: idata, xdata, code,
4 */
5 #include <testfwk.h>
6
7 #if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80)
8 # define idata
9 # define xdata
10 # define code
11 #endif
12
13 struct x {
14   short a;
15   char  b[10];
16 };
17
18 struct x {storage} teststruct[6] = {
19   { 10, {  1, 2, 3, 4, 5} },
20   { 20, { 11 } },
21   { 30, {  6, 7, 8} }
22 };
23
24 void
25 testZeropad(void)
26 {
27 #if ! (defined(SDCC_z80) || defined(SDCC_gbz80))
28   ASSERT(teststruct[0].b[1] ==  2);
29 #endif
30   ASSERT(teststruct[0].b[5] ==  0);
31   ASSERT(teststruct[1].b[0] == 11);
32
33   ASSERT(sizeof(teststruct[2].a) ==  2);
34   ASSERT(sizeof(teststruct[1].b) == 10);
35   ASSERT(sizeof(teststruct[1])   == 12);
36   ASSERT(sizeof(teststruct)      == 72);
37 }