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 842ecccc7ad812abb4a1acea6484f1a5050bfa24..20ffd3fb22efa38aaed3d7643c05af8ebb4fc545 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
index 2f4abae7fcf94da5bc4073442037a78e41d8271f..db332ccfd51421b7899995c1e8790a8de0246e3b 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-frexp.c
 
 Depends-on:
+isnan-nolibm
 
 configure.ac:
 AC_SUBST([FREXP_LIBM])
index 461f47cb1ae8c9fa43cd2faf3c6c50038e882993..b9bcca82c8331d91bfb71c247347284e3565685f 100644 (file)
@@ -3,6 +3,7 @@ tests/test-frexpl.c
 
 Depends-on:
 fpucw
+isnanl-nolibm
 
 configure.ac:
 
index 912ba200c314461c4688ac192f8aa40ba4e10132..96c640f7fcfb0bf2f26437d6e6de833ab39b6b21 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 447c3b9a7a98dd89a411be78465e33dca21c144b..7c66fc84014380dcec8bed0d5f6a721f1fc0ac87 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.  */