X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-isnanl.h;h=06e6a7cefaed00f5d878d1b70711f91b60a5846d;hb=fa1db0dd22768f09a507674a30beb5b8a87bb35f;hp=1665cf41cf858dbfb80b7d630d9329766aeae8f7;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/tests/test-isnanl.h b/tests/test-isnanl.h index 1665cf41c..06e6a7cef 100644 --- a/tests/test-isnanl.h +++ b/tests/test-isnanl.h @@ -1,5 +1,5 @@ /* Test of isnanl() substitute. - Copyright (C) 2007-2010 Free Software Foundation, Inc. + Copyright (C) 2007-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,25 +19,11 @@ #include #include +#include "minus-zero.h" +#include "infinity.h" #include "nan.h" #include "macros.h" -/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use minus_zero instead. - IRIX cc can't put -0.0L into .data, but can compute at runtime. - Note that the expression -LDBL_MIN * LDBL_MIN does not work on other - platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */ -#if defined __hpux || defined __sgi -static long double -compute_minus_zero (void) -{ - return -LDBL_MIN * LDBL_MIN; -} -# define minus_zero compute_minus_zero () -#else -long double minus_zero = -0.0L; -#endif - int main () { @@ -54,10 +40,10 @@ main () ASSERT (!isnanl (-2.718e30L)); ASSERT (!isnanl (-2.718e-30L)); ASSERT (!isnanl (0.0L)); - ASSERT (!isnanl (minus_zero)); + ASSERT (!isnanl (minus_zerol)); /* Infinite values. */ - ASSERT (!isnanl (1.0L / 0.0L)); - ASSERT (!isnanl (-1.0L / 0.0L)); + ASSERT (!isnanl (Infinityl ())); + ASSERT (!isnanl (- Infinityl ())); /* Quiet NaN. */ ASSERT (isnanl (NaNl ())); @@ -79,7 +65,7 @@ main () } #endif -#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN