* fixed GCC 4.4.0 mingw compilation:
[fw/sdcc] / src / regression / compare8.c
index eab3ffd7f32a4d7dbc41016e1c67616a8ef46b05..19da23a4825cfab1afff4f2318e33c983cb8b83d 100644 (file)
@@ -1,3 +1,5 @@
+#include "gpsim_assert.h"
+#include "picregs.h"
 // Signed comparisons of the form:  (variable>LIT)
 //
 // This regression test exercises all of the boundary
@@ -6,14 +8,12 @@
 // and each one has an astonishing capability of failing
 // a boundary condition.
 
-unsigned char success = 0;
 unsigned char failures = 0;
-unsigned char dummy = 0;
 unsigned char result = 0;
 
 //bit bit0 = 0;
-long int0 = 0;
-long int1 = 0;
+int int0 = 0;
+int int1 = 0;
 unsigned char uchar0 = 0;
 unsigned char uchar1 = 0;
 signed char char0 = 0;
@@ -21,13 +21,22 @@ signed char char1 = 0;
 char long0 = 0;
 char long1 = 0;
 
+/* *** NOTE ***  This particular test takes quite a while to run 
+ * ~ 10,000,000 instruction cycles. (2.5 seconds on a 20Mhz PIC).
+ * The WDT will reset the CPU if it's enabled. So disable it...
+*/
+
+typedef unsigned int word;
+
+//word at 0x2007  CONFIG = wdt_off & pwrte_on;
+
 void
-done ()
+done()
 {
-  dummy++;
+  ASSERT(MANGLE(failures) == 0);
+  PASSED();
 }
 
-
 void c_char_gt_lit1(unsigned char expected_result)
 {
   result = 0;
@@ -303,9 +312,11 @@ void
 main (void)
 {
   char_compare();
+  __asm clrwdt __endasm;
   int_compare1();
+  __asm clrwdt __endasm;
   int_compare2();
+  __asm clrwdt __endasm;
 
-  success = failures;
   done ();
 }