* support/regression/tests/constantRange.c:
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 6 Jul 2006 20:24:43 +0000 (20:24 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 6 Jul 2006 20:24:43 +0000 (20:24 +0000)
  fixed bug [ 1518317 ] regression test constantRange fails on alpha host

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4272 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
support/regression/tests/constantRange.c

index cbb59d688e1b9058e8aad634d16e6ab258469eac..58ba8339eaaeaec1d7f880dfb60e828e36cc5609 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * support/regression/tests/bitfields.c:
          fixed bug [ 1518322 ] regression test bitfields fails on ppc hosts
+       * support/regression/tests/constantRange.c:
+         fixed bug [ 1518317 ] regression test constantRange fails on alpha host
 
 2006-07-04 Borut Razem <borut.razem AT siol.net>
 
index 5c1feeef58b0a340f5540f827262ba03fc07192e..a4000aceac5d65e3909c556b1e04de63ad2972e6 100644 (file)
@@ -8,6 +8,13 @@
 #include <inttypes.h>
 #else
 #include <stdint.h>
+#endif
+
+#if defined (__GNUC__) && defined (__alpha__) && (__GNUC__ < 3)
+/* bool should be casted to int in order to pass the test. Is this a gcc bug? */
+#define INT_CAST  (int)
+#else
+#define INT_CAST
 #endif
 
  int8_t s8;
@@ -125,7 +132,7 @@ testFoo1(void)
   ASSERT (! ( 0 != sb));
   ASSERT (  ( 1 != sb));
 
-  ASSERT (  (-1 <  sb));
+  ASSERT (  (-1 <  INT_CAST sb));
   ASSERT (! ( 0 <  sb));
 
   ASSERT (  ( 0 <= sb));
@@ -134,7 +141,7 @@ testFoo1(void)
   ASSERT (! ( 0 >  sb));
   ASSERT (  ( 1 >  sb));
 
-  ASSERT (! (-1 >= sb));
+  ASSERT (! (-1 >= INT_CAST sb));
   ASSERT (  ( 0 >= sb));
 
 
@@ -146,7 +153,7 @@ testFoo1(void)
   ASSERT (! ( 0 != ub));
   ASSERT (  ( 1 != ub));
 
-  ASSERT (  (-1 <  ub));
+  ASSERT (  (-1 <  INT_CAST ub));
   ASSERT (! ( 0 <  ub));
 
   ASSERT (  ( 0 <= ub));
@@ -155,7 +162,7 @@ testFoo1(void)
   ASSERT (! ( 0 >  ub));
   ASSERT (  ( 1 >  ub));
 
-  ASSERT (! (-1 >= ub));
+  ASSERT (! (-1 >= INT_CAST ub));
   ASSERT (  ( 0 >= ub));
 }