changeset 10264:ebb7ea0c94e8

Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
author Ben Pfaff <blp@cs.stanford.edu>
date Sat, 12 Jul 2008 10:41:34 -0700
parents 0c43a5e428db
children ecc1f86df809
files ChangeLog NEWS lib/frexp.c lib/isfinite.c lib/isnand-nolibm.h lib/isnand.h lib/isnanf-nolibm.h lib/isnanf.h lib/signbitd.c lib/signbitf.c lib/vasnprintf.c modules/isnand-nolibm modules/isnand-nolibm-tests modules/isnanf-nolibm modules/isnanf-nolibm-tests tests/test-ceilf1.c tests/test-ceilf2.c tests/test-floorf1.c tests/test-floorf2.c tests/test-frexp.c tests/test-isnand-nolibm.c tests/test-isnand.c tests/test-isnanf-nolibm.c tests/test-isnanf.c tests/test-round1.c tests/test-round2.c tests/test-roundf1.c tests/test-strtod.c tests/test-trunc1.c tests/test-trunc2.c tests/test-truncf1.c tests/test-truncf2.c
diffstat 32 files changed, 290 insertions(+), 255 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2008-07-10  Ben Pfaff  <blp@gnu.org>
+
+	* lib/isnanf.h: Rename lib/isnanf-nolibm.h.
+	* lib/isnand.h: Rename lib/isnand-nolibm.h.
+	* tests/test-isnanf.c: Rename tests/test-isnanf-nolibm.c.
+	* tests/test-isnand.c: Rename tests/test-isnand-nolibm.c.
+	* modules/isnanf-nolibm: Update references to renamed files.
+	* modules/isnand-nolibm: Likewise.
+	* modules/isnanf-nolibm-tests: Likewise.
+	* modules/isnand-nolibm-tests: Likewise.
+        * lib/frexp.c: Likewise.
+	* lib/isfinite.c: Likewise.
+	* lib/signbitd.c: Likewise.
+	* lib/signbitf.c: Likewise.
+	* lib/vasnprintf.c: Likewise.
+	* tests/test-ceilf1.c: Likewise.
+	* tests/test-ceilf2.c: Likewise.
+	* tests/test-floorf1.c: Likewise.
+	* tests/test-floorf2.c: Likewise.
+	* tests/test-frexp.c: Likewise.
+	* tests/test-round1.c: Likewise.
+	* tests/test-round2.c: Likewise.
+	* tests/test-roundf1.c: Likewise.
+	* tests/test-strtod.c: Likewise.
+	* tests/test-trunc1.c: Likewise.
+	* tests/test-trunc2.c: Likewise.
+	* tests/test-truncf1.c: Likewise.
+	* tests/test-truncf2.c: Likewise.
+	* NEWS: Mention the renamed header files.
+
 2008-07-11  Jim Meyering  <meyering@redhat.com>
 
 	vc-list-files: make the last-resort awk code more portable
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,11 @@
 
 Date        Modules         Changes
 
+2008-07-07  isnanf-nolibm   The include file is changed from "isnanf.h"
+                            to "isnanf-nolibm.h".
+            isnand-nolibm   The include file is changed from "isnand.h"
+                            to "isnand-nolibm.h".
+
 2008-06-10  execute         The execute function takes an additional termsigp
                             argument. Passing termsigp = NULL is ok.
             wait-process    The wait_subprocess function takes an additional
--- a/lib/frexp.c
+++ b/lib/frexp.c
@@ -27,7 +27,7 @@
 # include "isnanl-nolibm.h"
 # include "fpucw.h"
 #else
-# include "isnand.h"
+# include "isnand-nolibm.h"
 #endif
 
 /* This file assumes FLT_RADIX = 2.  If FLT_RADIX is a power of 2 greater
--- a/lib/isfinite.c
+++ b/lib/isfinite.c
@@ -19,8 +19,8 @@
 
 #include <config.h>
 
-#include "isnanf.h"
-#include "isnand.h"
+#include "isnanf-nolibm.h"
+#include "isnand-nolibm.h"
 #include "isnanl-nolibm.h"
 
 int gl_isfinitef (float x)
new file mode 100644
--- /dev/null
+++ b/lib/isnand-nolibm.h
@@ -0,0 +1,33 @@
+/* Test for NaN that does not need libm.
+   Copyright (C) 2007-2008 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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#if HAVE_ISNAND_IN_LIBC
+/* Get declaration of isnan macro.  */
+# include <math.h>
+# if __GNUC__ >= 4
+   /* GCC 4.0 and newer provides three built-ins for isnan.  */
+#  undef isnand
+#  define isnand(x) __builtin_isnan ((double)(x))
+# else
+#  undef isnand
+#  define isnand(x) isnan ((double)(x))
+# endif
+#else
+/* Test whether X is a NaN.  */
+# undef isnand
+# define isnand rpl_isnand
+extern int isnand (double x);
+#endif
deleted file mode 100644
--- a/lib/isnand.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test for NaN that does not need libm.
-   Copyright (C) 2007-2008 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
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if HAVE_ISNAND_IN_LIBC
-/* Get declaration of isnan macro.  */
-# include <math.h>
-# if __GNUC__ >= 4
-   /* GCC 4.0 and newer provides three built-ins for isnan.  */
-#  undef isnand
-#  define isnand(x) __builtin_isnan ((double)(x))
-# else
-#  undef isnand
-#  define isnand(x) isnan ((double)(x))
-# endif
-#else
-/* Test whether X is a NaN.  */
-# undef isnand
-# define isnand rpl_isnand
-extern int isnand (double x);
-#endif
new file mode 100644
--- /dev/null
+++ b/lib/isnanf-nolibm.h
@@ -0,0 +1,33 @@
+/* Test for NaN that does not need libm.
+   Copyright (C) 2007-2008 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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#if HAVE_ISNANF_IN_LIBC
+/* Get declaration of isnan macro or (older) isnanf function.  */
+# include <math.h>
+# if __GNUC__ >= 4
+   /* GCC 4.0 and newer provides three built-ins for isnan.  */
+#  undef isnanf
+#  define isnanf(x) __builtin_isnanf ((float)(x))
+# elif defined isnan
+#  undef isnanf
+#  define isnanf(x) isnan ((float)(x))
+# endif
+#else
+/* Test whether X is a NaN.  */
+# undef isnanf
+# define isnanf rpl_isnanf
+extern int isnanf (float x);
+#endif
deleted file mode 100644
--- a/lib/isnanf.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test for NaN that does not need libm.
-   Copyright (C) 2007-2008 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
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if HAVE_ISNANF_IN_LIBC
-/* Get declaration of isnan macro or (older) isnanf function.  */
-# include <math.h>
-# if __GNUC__ >= 4
-   /* GCC 4.0 and newer provides three built-ins for isnan.  */
-#  undef isnanf
-#  define isnanf(x) __builtin_isnanf ((float)(x))
-# elif defined isnan
-#  undef isnanf
-#  define isnanf(x) isnan ((float)(x))
-# endif
-#else
-/* Test whether X is a NaN.  */
-# undef isnanf
-# define isnanf rpl_isnanf
-extern int isnanf (float x);
-#endif
--- a/lib/signbitd.c
+++ b/lib/signbitd.c
@@ -20,7 +20,7 @@
 #include <math.h>
 
 #include <string.h>
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "float+.h"
 
 #undef gl_signbitd
--- a/lib/signbitf.c
+++ b/lib/signbitf.c
@@ -20,7 +20,7 @@
 #include <math.h>
 
 #include <string.h>
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "float+.h"
 
 #undef gl_signbitf
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -95,7 +95,7 @@
 
 #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
 # include <math.h>
-# include "isnand.h"
+# include "isnand-nolibm.h"
 #endif
 
 #if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
@@ -106,7 +106,7 @@
 
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
 # include <math.h>
-# include "isnand.h"
+# include "isnand-nolibm.h"
 # include "printf-frexp.h"
 #endif
 
--- a/modules/isnand-nolibm
+++ b/modules/isnand-nolibm
@@ -2,7 +2,7 @@
 isnand() function: test for NaN, without requiring libm.
 
 Files:
-lib/isnand.h
+lib/isnand-nolibm.h
 lib/isnand.c
 lib/isnan.c
 lib/float+.h
@@ -17,7 +17,7 @@
 Makefile.am:
 
 Include:
-#include "isnand.h"
+#include "isnand-nolibm.h"
 
 License:
 LGPL
--- a/modules/isnand-nolibm-tests
+++ b/modules/isnand-nolibm-tests
@@ -1,5 +1,5 @@
 Files:
-tests/test-isnand.c
+tests/test-isnand-nolibm.c
 tests/nan.h
 
 Depends-on:
@@ -8,6 +8,6 @@
 gl_DOUBLE_EXPONENT_LOCATION
 
 Makefile.am:
-TESTS += test-isnand
-check_PROGRAMS += test-isnand
+TESTS += test-isnand-nolibm
+check_PROGRAMS += test-isnand-nolibm
 
--- a/modules/isnanf-nolibm
+++ b/modules/isnanf-nolibm
@@ -2,7 +2,7 @@
 isnanf() function: test for NaN, without requiring libm.
 
 Files:
-lib/isnanf.h
+lib/isnanf-nolibm.h
 lib/isnanf.c
 lib/isnan.c
 lib/float+.h
@@ -17,7 +17,7 @@
 Makefile.am:
 
 Include:
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 License:
 LGPL
--- a/modules/isnanf-nolibm-tests
+++ b/modules/isnanf-nolibm-tests
@@ -1,5 +1,5 @@
 Files:
-tests/test-isnanf.c
+tests/test-isnanf-nolibm.c
 tests/nan.h
 
 Depends-on:
@@ -8,6 +8,6 @@
 gl_FLOAT_EXPONENT_LOCATION
 
 Makefile.am:
-TESTS += test-isnanf
-check_PROGRAMS += test-isnanf
+TESTS += test-isnanf-nolibm
+check_PROGRAMS += test-isnanf-nolibm
 
--- a/tests/test-ceilf1.c
+++ b/tests/test-ceilf1.c
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
--- a/tests/test-ceilf2.c
+++ b/tests/test-ceilf2.c
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 #define ASSERT(expr) \
   do									     \
--- a/tests/test-floorf1.c
+++ b/tests/test-floorf1.c
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
--- a/tests/test-floorf2.c
+++ b/tests/test-floorf2.c
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 #define ASSERT(expr) \
   do									     \
--- a/tests/test-frexp.c
+++ b/tests/test-frexp.c
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "nan.h"
 
 /* Avoid some warnings from "gcc -Wshadow".
new file mode 100644
--- /dev/null
+++ b/tests/test-isnand-nolibm.c
@@ -0,0 +1,78 @@
+/* Test of isnand() substitute.
+   Copyright (C) 2007-2008 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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include "isnand-nolibm.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "nan.h"
+
+#define ASSERT(expr) \
+  do									     \
+    {									     \
+      if (!(expr))							     \
+        {								     \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);						     \
+          abort ();							     \
+        }								     \
+    }									     \
+  while (0)
+
+int
+main ()
+{
+  /* Finite values.  */
+  ASSERT (!isnand (3.141));
+  ASSERT (!isnand (3.141e30));
+  ASSERT (!isnand (3.141e-30));
+  ASSERT (!isnand (-2.718));
+  ASSERT (!isnand (-2.718e30));
+  ASSERT (!isnand (-2.718e-30));
+  ASSERT (!isnand (0.0));
+  ASSERT (!isnand (-0.0));
+  /* Infinite values.  */
+  ASSERT (!isnand (1.0 / 0.0));
+  ASSERT (!isnand (-1.0 / 0.0));
+  /* Quiet NaN.  */
+  ASSERT (isnand (NaNd ()));
+#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
+  /* Signalling NaN.  */
+  {
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+    typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+    memory_double m;
+    m.value = NaNd ();
+# if DBL_EXPBIT0_BIT > 0
+    m.word[DBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (DBL_EXPBIT0_BIT - 1);
+# else
+    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+# endif
+    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+      |= (unsigned int) 1 << DBL_EXPBIT0_BIT;
+    ASSERT (isnand (m.value));
+  }
+#endif
+  return 0;
+}
deleted file mode 100644
--- a/tests/test-isnand.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Test of isnand() substitute.
-   Copyright (C) 2007-2008 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
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include "isnand.h"
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "nan.h"
-
-#define ASSERT(expr) \
-  do									     \
-    {									     \
-      if (!(expr))							     \
-        {								     \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);						     \
-          abort ();							     \
-        }								     \
-    }									     \
-  while (0)
-
-int
-main ()
-{
-  /* Finite values.  */
-  ASSERT (!isnand (3.141));
-  ASSERT (!isnand (3.141e30));
-  ASSERT (!isnand (3.141e-30));
-  ASSERT (!isnand (-2.718));
-  ASSERT (!isnand (-2.718e30));
-  ASSERT (!isnand (-2.718e-30));
-  ASSERT (!isnand (0.0));
-  ASSERT (!isnand (-0.0));
-  /* Infinite values.  */
-  ASSERT (!isnand (1.0 / 0.0));
-  ASSERT (!isnand (-1.0 / 0.0));
-  /* Quiet NaN.  */
-  ASSERT (isnand (NaNd ()));
-#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
-  /* Signalling NaN.  */
-  {
-    #define NWORDS \
-      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-    typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-    memory_double m;
-    m.value = NaNd ();
-# if DBL_EXPBIT0_BIT > 0
-    m.word[DBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (DBL_EXPBIT0_BIT - 1);
-# else
-    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
-      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
-    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
-      |= (unsigned int) 1 << DBL_EXPBIT0_BIT;
-    ASSERT (isnand (m.value));
-  }
-#endif
-  return 0;
-}
new file mode 100644
--- /dev/null
+++ b/tests/test-isnanf-nolibm.c
@@ -0,0 +1,80 @@
+/* Test of isnanf() substitute.
+   Copyright (C) 2007-2008 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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include "isnanf-nolibm.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "nan.h"
+
+#define ASSERT(expr) \
+  do									     \
+    {									     \
+      if (!(expr))							     \
+        {								     \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);						     \
+          abort ();							     \
+        }								     \
+    }									     \
+  while (0)
+
+int
+main ()
+{
+  /* Finite values.  */
+  ASSERT (!isnanf (3.141f));
+  ASSERT (!isnanf (3.141e30f));
+  ASSERT (!isnanf (3.141e-30f));
+  ASSERT (!isnanf (-2.718f));
+  ASSERT (!isnanf (-2.718e30f));
+  ASSERT (!isnanf (-2.718e-30f));
+  ASSERT (!isnanf (0.0f));
+  ASSERT (!isnanf (-0.0f));
+  /* Infinite values.  */
+  ASSERT (!isnanf (1.0f / 0.0f));
+  ASSERT (!isnanf (-1.0f / 0.0f));
+  /* Quiet NaN.  */
+  ASSERT (isnanf (NaNf ()));
+#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
+  /* Signalling NaN.  */
+  {
+    #define NWORDS \
+      ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+    typedef union { float value; unsigned int word[NWORDS]; } memory_float;
+    memory_float m;
+    m.value = NaNf ();
+# if FLT_EXPBIT0_BIT > 0
+    m.word[FLT_EXPBIT0_WORD] ^= (unsigned int) 1 << (FLT_EXPBIT0_BIT - 1);
+# else
+    m.word[FLT_EXPBIT0_WORD + (FLT_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+# endif
+    if (FLT_EXPBIT0_WORD < NWORDS / 2)
+      m.word[FLT_EXPBIT0_WORD + 1] |= (unsigned int) 1 << FLT_EXPBIT0_BIT;
+    else
+      m.word[0] |= (unsigned int) 1;
+    ASSERT (isnanf (m.value));
+  }
+#endif
+  return 0;
+}
deleted file mode 100644
--- a/tests/test-isnanf.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Test of isnanf() substitute.
-   Copyright (C) 2007-2008 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
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include "isnanf.h"
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "nan.h"
-
-#define ASSERT(expr) \
-  do									     \
-    {									     \
-      if (!(expr))							     \
-        {								     \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);						     \
-          abort ();							     \
-        }								     \
-    }									     \
-  while (0)
-
-int
-main ()
-{
-  /* Finite values.  */
-  ASSERT (!isnanf (3.141f));
-  ASSERT (!isnanf (3.141e30f));
-  ASSERT (!isnanf (3.141e-30f));
-  ASSERT (!isnanf (-2.718f));
-  ASSERT (!isnanf (-2.718e30f));
-  ASSERT (!isnanf (-2.718e-30f));
-  ASSERT (!isnanf (0.0f));
-  ASSERT (!isnanf (-0.0f));
-  /* Infinite values.  */
-  ASSERT (!isnanf (1.0f / 0.0f));
-  ASSERT (!isnanf (-1.0f / 0.0f));
-  /* Quiet NaN.  */
-  ASSERT (isnanf (NaNf ()));
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
-  /* Signalling NaN.  */
-  {
-    #define NWORDS \
-      ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-    typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-    memory_float m;
-    m.value = NaNf ();
-# if FLT_EXPBIT0_BIT > 0
-    m.word[FLT_EXPBIT0_WORD] ^= (unsigned int) 1 << (FLT_EXPBIT0_BIT - 1);
-# else
-    m.word[FLT_EXPBIT0_WORD + (FLT_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
-      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
-    if (FLT_EXPBIT0_WORD < NWORDS / 2)
-      m.word[FLT_EXPBIT0_WORD + 1] |= (unsigned int) 1 << FLT_EXPBIT0_BIT;
-    else
-      m.word[0] |= (unsigned int) 1;
-    ASSERT (isnanf (m.value));
-  }
-#endif
-  return 0;
-}
--- a/tests/test-round1.c
+++ b/tests/test-round1.c
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
--- a/tests/test-round2.c
+++ b/tests/test-round2.c
@@ -37,7 +37,7 @@
 #ifdef USE_LONG_DOUBLE
 # error Long double not supported.
 #elif ! defined USE_FLOAT
-# include "isnand.h"
+# include "isnand-nolibm.h"
 # define ISNAN isnand
 # define FUNCTION "round"
 # define DOUBLE_UINT uint64_t
@@ -45,7 +45,7 @@
 # define NUM_HIGHBITS 13
 # define NUM_LOWBITS 4
 #else /* defined USE_FLOAT */
-# include "isnanf.h"
+# include "isnanf-nolibm.h"
 # define ISNAN isnanf
 # define FUNCTION "roundf"
 # define DOUBLE_UINT uint32_t
--- a/tests/test-roundf1.c
+++ b/tests/test-roundf1.c
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
--- a/tests/test-strtod.c
+++ b/tests/test-strtod.c
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 
 #define ASSERT(expr) \
   do									     \
--- a/tests/test-trunc1.c
+++ b/tests/test-trunc1.c
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
--- a/tests/test-trunc2.c
+++ b/tests/test-trunc2.c
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 
 #define ASSERT(expr) \
   do									     \
--- a/tests/test-truncf1.c
+++ b/tests/test-truncf1.c
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
--- a/tests/test-truncf2.c
+++ b/tests/test-truncf2.c
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 #define ASSERT(expr) \
   do									     \