* support/regression/tests/constantRange.c,
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 7 Jun 2007 20:33:22 +0000 (20:33 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 7 Jun 2007 20:33:22 +0000 (20:33 +0000)
  support/regression/tests/scott-compare3.c: fixed failing regression
  tests, uncovered by implementation of more flexible rule for detection
  of testing functions

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

ChangeLog
support/regression/tests/constantRange.c
support/regression/tests/scott-compare3.c

index 9ddf1610f78046f68a45c0d79edafe53ce7c72c8..f9fb2401da38f166ef3507ad6fa4a35589943ae3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
        * support/regression/generate-cases.py: implemented more flexible rule
          for detection of testing functions, allowing white-spaces surrounding
          the function name and the 'void' parameter.
+       * support/regression/tests/constantRange.c,
+         support/regression/tests/scott-compare3.c: fixed failing regression
+         tests, uncovered by implementation of more flexible rule for detection
+         of testing functions
 
 2007-06-04 Maarten Brock <sourceforge.brock AT dse.nl>
 
index a4000aceac5d65e3909c556b1e04de63ad2972e6..1dfc10cfdbc63a490a7f5426bdc06468e8c7cda6 100644 (file)
@@ -73,15 +73,23 @@ testConstantRange (void)
   ASSERT (! (UINT16_MAX + 1L == u16));
   ASSERT (  (         0 - 1  != u16));
   ASSERT (  (UINT16_MAX + 1L != u16));
-  ASSERT (  (         0 - 1  <  u16));
   ASSERT (! (UINT16_MAX      <  u16));
   ASSERT (  (         0      <= u16));
   ASSERT (! (UINT16_MAX + 1L <= u16));
   ASSERT (! (         0      >  u16));
   ASSERT (  (UINT16_MAX + 1L >  u16));
-  ASSERT (! (         0 - 1  >= u16));
   ASSERT (  (UINT16_MAX      >= u16));
 
+#if defined(PORT_HOST)
+/* on 32bit host: -1 is presented as 32 bit int, 16 bit unsigned short is promoted to 32 bit int */
+  ASSERT (  (         0 - 1  <  u16)); /* -1 > 0 */
+  ASSERT (! (         0 - 1  >= u16)); /* !(-1 <= 0) */
+#else
+/* on 16bit sdcc: int (-1) is promoted to unsigned int (0xffff) */
+  ASSERT (  (         0 - 1  >  u16)); /* 0xffff > 0 */
+  ASSERT (! (         0 - 1  <= u16)); /* !(0xffff <= 0) */
+#endif
+
    /* sdcc can't hold a number (INT32_MIN - 1) or (INT32_MAX + 1),
       there's no 'double' or 'long long' */
 /* ASSERT (! (INT32_MIN - 1 == s32)); */
@@ -101,13 +109,13 @@ testConstantRange (void)
 /* ASSERT (! (UINT32_MAX + 1 == u32)); */
    ASSERT (  (         0 - 1 != u32));
 /* ASSERT (  (UINT32_MAX + 1 != u32)); */
-   ASSERT (  (         0 - 1 <  u32));
+   ASSERT (  (         0 - 1 >  u32)); /* 0xffffffff > 0 */
    ASSERT (! (UINT32_MAX     <  u32));
    ASSERT (  (         0     <= u32));
 /* ASSERT (! (UINT32_MAX + 1 <= u32)); */
    ASSERT (! (         0     >  u32));
 /* ASSERT (  (UINT32_MAX + 1 >  u32)); */
-   ASSERT (! (         0 - 1 >= u32));
+   ASSERT (! (         0 - 1 <= u32)); /* !(0xffffffff <= 0) */
    ASSERT (  (UINT32_MAX     >= u32));
 }
 
index 31b22b70df709b8e0206195d9f8b00034e900732..9bdd8ba9fa72b928c31e86b7b2f11c2cd8e7a19f 100644 (file)
@@ -142,7 +142,7 @@ void c_abcd(void)
 
   ASSERT(!(aint0 == 0x00cd));
 
-  ASSERT(!(aint0 == (unsigned int)0x1234abcdU));
+  ASSERT(aint0 == (unsigned short int)0x1234abcdU);
 
 }