From 076e99e2af11eb12b976dd1d936c6ebab6ece27f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 25 Mar 2007 20:58:03 +0000 Subject: [PATCH] Work around IRIX 6.5 cc compiler bug, which simplifies x != x to false. --- ChangeLog | 10 ++++++++++ modules/frexp-tests | 1 + modules/frexpl-tests | 1 + tests/test-frexp.c | 4 +++- tests/test-frexpl.c | 3 ++- 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 842ecccc7..20ffd3fb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2007-03-25 Bruno Haible + * 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 + * 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. diff --git a/modules/frexp-tests b/modules/frexp-tests index 2f4abae7f..db332ccfd 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 461f47cb1..b9bcca82c 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 912ba200c..96c640f7f 100644 --- a/tests/test-frexp.c +++ b/tests/test-frexp.c @@ -24,6 +24,8 @@ #include #include +#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 447c3b9a7..7c66fc840 100644 --- a/tests/test-frexpl.c +++ b/tests/test-frexpl.c @@ -25,6 +25,7 @@ #include #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. */ -- 2.11.0