projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Makefile.in, configure.in, configure,
[fw/sdcc]
/
src
/
regression
/
or1.c
diff --git
a/src/regression/or1.c
b/src/regression/or1.c
index b17834e66d59b8936ed2cc0f25fd1f71c3e3e879..b828eb0032ef9a21e73b27d0202d14e05ae977b6 100644
(file)
--- a/
src/regression/or1.c
+++ b/
src/regression/or1.c
@@
-1,11
+1,16
@@
+#include "gpsim_assert.h"
+
+/* 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 0
-unsigned char success=0;
unsigned char failures=0;
unsigned char failures=0;
-unsigned char dummy=0;
+#if SUPPORT_BIT_TYPES
bit bit0 = 0;
bit bit1 = 0;
bit bit2 = 0;
bit bit0 = 0;
bit bit1 = 0;
bit bit2 = 0;
+#endif
unsigned int uint0 = 0;
unsigned int uint1 = 0;
unsigned int uint0 = 0;
unsigned int uint1 = 0;
@@
-14,11
+19,11
@@
unsigned char uchar1 = 0;
unsigned long ulong0 = 0;
unsigned long ulong1 = 0;
unsigned long ulong0 = 0;
unsigned long ulong1 = 0;
-void done()
+void
+done()
{
{
-
- dummy++;
-
+ ASSERT(MANGLE(failures) == 0);
+ PASSED();
}
// uchar0 = 0;
}
// uchar0 = 0;
@@
-139,6
+144,7
@@
void or_uint2uint(void)
}
}
+#if SUPPORT_BIT_TYPES
void or_bits1(void)
{
void or_bits1(void)
{
@@
-152,6
+158,7
@@
void or_bits2(void)
bit0 = bit1 | bit2;
}
bit0 = bit1 | bit2;
}
+#endif
void main(void)
{
void main(void)
{
@@
-168,6
+175,7
@@
void main(void)
uint1=1;
or_uint2uint();
uint1=1;
or_uint2uint();
+#if SUPPORT_BIT_TYPES
or_bits1();
if(bit0)
failures++;
or_bits1();
if(bit0)
failures++;
@@
-184,8
+192,7
@@
void main(void)
or_bits2();
if(!bit0)
failures++;
or_bits2();
if(!bit0)
failures++;
+#endif
-
- success = failures;
done();
}
done();
}