1 #include "gpsim_assert.h"
3 // Addition tests - mostly int's
5 /* bit types are not ANSI - so provide a way of disabling bit types
6 * if this file is used to test other compilers besides SDCC */
7 #define SUPPORT_BIT_TYPES 0
10 unsigned char failures=0;
13 unsigned int aint0 = 0;
14 unsigned int aint1 = 0;
15 unsigned int aint2 = 0;
16 unsigned int aint3 = 0;
17 unsigned char achar0 = 0;
18 unsigned char achar1 = 0;
19 unsigned char achar2 = 0;
20 unsigned char achar3 = 0;
21 unsigned char *acharP = 0;
44 ASSERT(MANGLE(failures) == 0);
48 void add_lit2uint(void)
61 aint0 = aint0 +1; // Should be an increment
65 for(aint1 = 0; aint1 < 100; aint1++)
73 void add_uint2uint (void)
76 aint1 = aint1 + aint0;
81 for(aint2 = 0; aint2<7; aint2++)
92 // aint2, aint3 can be anything.
94 void add_uint2uint2(void)
109 aint2 = aint1 + aint0;
113 aint3 = aint2 + aint1 + aint0;
129 aint3 = aint2 + aint1 + aint0;
136 #if SUPPORT_BIT_TYPES
155 bit3 = bit4+bit5+bit6+bit7+bit0;
161 /* add_bit2uchar(void) - assumes bit0 = 1, aint0 = 7 */
163 #if SUPPORT_BIT_TYPES
164 void add_bit2uchar(void)
177 void add_bit2uint(void)
190 /***********************************/
311 #if SUPPORT_BIT_TYPES