+#include "gpsim_assert.h"
// Addition tests - mostly int's
/* bit types are not ANSI - so provide a way of disabling bit types
* if this file is used to test other compilers besides SDCC */
-#define SUPPORT_BIT_TYPES 1
+#define SUPPORT_BIT_TYPES 0
-unsigned char success=0;
unsigned char failures=0;
-unsigned char dummy=0;
char char0 = 0;
#endif
-void done()
+void
+done()
{
-
- dummy++;
-
+ ASSERT(MANGLE(failures) == 0);
+ PASSED();
}
void add_char2char(void)
}
+void add_compound_char(void)
+{
+ char0 = char1+5;
+
+ if(char0 != 9)
+ failures++;
+
+ if((char0+char1) != 13)
+ failures++;
+}
+
void add_int2int(void)
{
if(int0 != 4)
}
+void add_compound_int(void)
+{
+ int0 = int1+5;
+
+ if(int0 != 9)
+ failures++;
+
+ if((int0+int1) != 13)
+ failures++;
+}
+
+
void add_lit2long(void)
{
char1 = char0 + 1;
add_char2char();
+ char1=4;
+ add_compound_char();
+
int0 = 4;
int1 = int0 + 1;
add_int2int();
+ int1=4;
+ add_compound_int();
+
add_lit2long();
add_lit2ulong();
- success = failures;
done();
}