Work around IRIX 6.5 cc compiler bug, which simplifies x != x to false.
authorBruno Haible <bruno@clisp.org>
Sun, 25 Mar 2007 20:58:03 +0000 (20:58 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Mar 2007 20:58:03 +0000 (20:58 +0000)
ChangeLog
modules/frexp-tests
modules/frexpl-tests
tests/test-frexp.c
tests/test-frexpl.c

index 842eccc..20ffd3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2007-03-25  Bruno Haible  <bruno@clisp.org>
 
+       * tests/test-frexpl.c: Include isnanl-nolibm.h.
+       (main): Use isnanl instead of x != x idiom.
+       * modules/frexpl-tests (Depends-on): Add isnanl-nolibm.
+
+       * tests/test-frexp.c: Include isnan.h.
+       (main): Use isnan instead of x != x idiom.
+       * modules/frexp-tests (Depends-on): Add isnan-nolibm.
+
+2007-03-25  Bruno Haible  <bruno@clisp.org>
+
        * tests/test-frexp.c (NaN): New function/macro.
        (main): Use it instead of 0.0 / 0.0.
        * tests/test-isnan.c (NaN): New function/macro.
index 2f4abae..db332cc 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-frexp.c
 
 Depends-on:
+isnan-nolibm
 
 configure.ac:
 AC_SUBST([FREXP_LIBM])
index 461f47c..b9bcca8 100644 (file)
@@ -3,6 +3,7 @@ tests/test-frexpl.c
 
 Depends-on:
 fpucw
+isnanl-nolibm
 
 configure.ac:
 
index 912ba20..96c640f 100644 (file)
@@ -24,6 +24,8 @@
 #include <float.h>
 #include <stdlib.h>
 
+#include "isnan.h"
+
 #define ASSERT(expr) if (!(expr)) abort ();
 
 /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
@@ -64,7 +66,7 @@ main ()
     double mantissa;
     x = NaN ();
     mantissa = frexp (x, &exp);
-    ASSERT (mantissa != mantissa);
+    ASSERT (isnan (mantissa));
   }
 
   { /* Positive infinity.  */
index 447c3b9..7c66fc8 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 
 #include "fpucw.h"
+#include "isnanl-nolibm.h"
 
 #define ASSERT(expr) if (!(expr)) abort ();
 
@@ -52,7 +53,7 @@ main ()
     long double mantissa;
     x = 0.0L / 0.0L;
     mantissa = frexpl (x, &exp);
-    ASSERT (mantissa != mantissa);
+    ASSERT (isnanl (mantissa));
   }
 
   { /* Positive infinity.  */