3 type: bool, char, short, long
13 /* This is not only a regression test, the focus of this test
14 is more on the generated code (volatile!). */
18 #if defined(TYPE_bool)
21 # define UNSIGNED unsigned
24 #if defined(__SDCC_MODEL_SMALL)
25 # define _data __idata
30 #if defined(TYPE_bool) && defined(__bool_true_false_are_defined)
32 #elif defined(TYPE_bool) && !defined(__bool_true_false_are_defined)
33 # if defined(PORT_HOST)
34 # define MASK 0xffffffff
39 #elif defined(TYPE_char)
41 #elif defined(TYPE_short)
43 #elif defined(TYPE_long)
44 # define MASK 0xffffffff
46 # warning Unknown type
49 #if !(defined(__SDCC_pdk14) && defined(TYPE_long)) // Not enough RAM
50 /* the variable 'mask' is only defined to see if MASK is correctly set up */
51 const unsigned long mask
= MASK
;
54 volatile UNSIGNED
{type
} uv
;
55 /* an array would be nicer, but an array of bits isn't possible */
56 _data
{type
} a0
, a1
, a2
, a3
, a4
, a5
, a6
, a7
, a8
, a9
57 #if !(defined(__SDCC_pdk14) && defined(TYPE_short)) // Not enough RAM
58 , a10
, a11
, a15
, a12
, a13
, a14
, a16
, a17
, a18
, a19
, a20
61 _data UNSIGNED
{type
} ua0
, ua1
, ua2
, ua3
, ua4
, ua5
, ua6
;
63 _data
volatile UNSIGNED
{type
} ub
= 0xbe;
69 #if !(defined(__SDCC_pdk14) && defined(TYPE_long)) // Not enough RAM
97 #if !(defined(__SDCC_pdk14) && defined(TYPE_short)) // Not enough RAM
108 #if !(defined(__SDCC_pdk14) && defined(TYPE_short)) // Not enough RAM
115 #if !(defined(__SDCC_pdk14) && defined(TYPE_short)) // Not enough RAM
129 #if defined(TYPE_bool) && defined(__bool_true_false_are_defined)
138 ASSERT( a3
== ({type
}) 0x33);
139 ASSERT(ua1
== ({type
}) 0x7b);
140 ASSERT( a5
== ({type
}) 0x33);
149 #if !(defined(__SDCC_pdk14) && defined(TYPE_short)) // Not enough RAM
150 ASSERT( a10
== ({type
}) MASK
);
151 ASSERT( a11
== ({type
}) MASK
);
156 // ASSERT( a14 == 0);
157 ASSERT( a15
== ({type
}) MASK
);
160 ASSERT( a17
== ({type
}) MASK
);
163 // ASSERT( a20 == 0);
165 ASSERT( v
== ({type
}) MASK
);