From: Bruno Haible <bruno@clisp.org>
Date: Sun, 25 Mar 2007 20:58:03 +0000 (+0000)
Subject: Work around IRIX 6.5 cc compiler bug, which simplifies x != x to false.
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=076e99e2af11eb12b976dd1d936c6ebab6ece27f;p=pspp

Work around IRIX 6.5 cc compiler bug, which simplifies x != x to false.
---

diff --git a/ChangeLog b/ChangeLog
index 842ecccc7a..20ffd3fb22 100644
--- 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.
diff --git a/modules/frexp-tests b/modules/frexp-tests
index 2f4abae7fc..db332ccfd5 100644
--- a/modules/frexp-tests
+++ b/modules/frexp-tests
@@ -2,6 +2,7 @@ Files:
 tests/test-frexp.c
 
 Depends-on:
+isnan-nolibm
 
 configure.ac:
 AC_SUBST([FREXP_LIBM])
diff --git a/modules/frexpl-tests b/modules/frexpl-tests
index 461f47cb1a..b9bcca82c8 100644
--- a/modules/frexpl-tests
+++ b/modules/frexpl-tests
@@ -3,6 +3,7 @@ tests/test-frexpl.c
 
 Depends-on:
 fpucw
+isnanl-nolibm
 
 configure.ac:
 
diff --git a/tests/test-frexp.c b/tests/test-frexp.c
index 912ba200c3..96c640f7fc 100644
--- a/tests/test-frexp.c
+++ b/tests/test-frexp.c
@@ -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.  */
diff --git a/tests/test-frexpl.c b/tests/test-frexpl.c
index 447c3b9a7a..7c66fc8401 100644
--- a/tests/test-frexpl.c
+++ b/tests/test-frexpl.c
@@ -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.  */