Avoid test failures on IRIX 6.5.
authorBruno Haible <bruno@clisp.org>
Sat, 19 May 2007 22:30:24 +0000 (22:30 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 19 May 2007 22:30:24 +0000 (22:30 +0000)
tests/test-fprintf-posix.h
tests/test-printf-posix.h
tests/test-printf-posix.output

index f076a72..8671da4 100644 (file)
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
-/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
-#ifdef __DECC
-static double
-NaN ()
-{
-  static double zero = 0.0;
-  return zero / zero;
-}
-#else
-# define NaN() (0.0 / 0.0)
-#endif
-
 static void
 test_function (int (*my_fprintf) (FILE *, const char *, ...))
 {
@@ -58,15 +46,9 @@ test_function (int (*my_fprintf) (FILE *, const char *, ...))
   /* Negative infinity.  */
   my_fprintf (stdout, "%a %d\n", -1.0 / 0.0, 33, 44, 55);
 
-  /* NaN.  */
-  my_fprintf (stdout, "%a %d\n", NaN (), 33, 44, 55);
-
   /* FLAG_ZERO with infinite number.  */
   my_fprintf (stdout, "%010a %d\n", 1.0 / 0.0, 33, 44, 55);
 
-  /* FLAG_ZERO with NaN.  */
-  my_fprintf (stdout, "%010a %d\n", NaN (), 33, 44, 55);
-
   /* Test the support of the %f format directive.  */
 
   /* A positive number.  */
@@ -84,9 +66,6 @@ test_function (int (*my_fprintf) (FILE *, const char *, ...))
   /* Negative zero.  */
   my_fprintf (stdout, "%f %d\n", -0.0, 33, 44, 55);
 
-  /* NaN.  */
-  my_fprintf (stdout, "%f %d\n", NaN (), 33, 44, 55);
-
   /* FLAG_ZERO.  */
   my_fprintf (stdout, "%015f %d\n", 1234.0, 33, 44, 55);
 
@@ -108,11 +87,6 @@ test_function (int (*my_fprintf) (FILE *, const char *, ...))
   /* Negative zero.  */
   my_fprintf (stdout, "%Lf %d\n", -0.0L, 33, 44, 55);
 
-  { /* NaN.  */
-    static long double zero = 0.0L;
-    my_fprintf (stdout, "%Lf %d\n", zero / zero, 33, 44, 55);
-  }
-
   /* FLAG_ZERO.  */
   my_fprintf (stdout, "%015Lf %d\n", 1234.0L, 33, 44, 55);
 
@@ -136,9 +110,6 @@ test_function (int (*my_fprintf) (FILE *, const char *, ...))
   /* Negative zero.  */
   my_fprintf (stdout, "%F %d\n", -0.0, 33, 44, 55);
 
-  /* NaN.  */
-  my_fprintf (stdout, "%F %d\n", NaN (), 33, 44, 55);
-
   /* FLAG_ZERO.  */
   my_fprintf (stdout, "%015F %d\n", 1234.0, 33, 44, 55);
 
@@ -160,11 +131,6 @@ test_function (int (*my_fprintf) (FILE *, const char *, ...))
   /* Negative zero.  */
   my_fprintf (stdout, "%LF %d\n", -0.0L, 33, 44, 55);
 
-  { /* NaN.  */
-    static long double zero = 0.0L;
-    my_fprintf (stdout, "%LF %d\n", zero / zero, 33, 44, 55);
-  }
-
   /* FLAG_ZERO.  */
   my_fprintf (stdout, "%015LF %d\n", 1234.0L, 33, 44, 55);
 
index 1b2da47..367dba9 100644 (file)
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
-/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
-#ifdef __DECC
-static double
-NaN ()
-{
-  static double zero = 0.0;
-  return zero / zero;
-}
-#else
-# define NaN() (0.0 / 0.0)
-#endif
-
 static void
 test_function (int (*my_printf) (const char *, ...))
 {
@@ -58,19 +46,11 @@ test_function (int (*my_printf) (const char *, ...))
   /* Negative infinity.  */
   my_printf ("%a %d\n", -1.0 / 0.0, 33, 44, 55);
 
-  /* NaN.  */
-  my_printf ("%a %d\n", NaN (), 33, 44, 55);
-
   /* FLAG_ZERO with infinite number.  */
   /* "0000000inf 33" is not a valid result; see
      <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
   my_printf ("%010a %d\n", 1.0 / 0.0, 33, 44, 55);
 
-  /* FLAG_ZERO with NaN.  */
-  /* "0000000nan 33" is not a valid result; see
-     <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
-  my_printf ("%010a %d\n", NaN (), 33, 44, 55);
-
   /* Test the support of the %f format directive.  */
 
   /* A positive number.  */
@@ -88,9 +68,6 @@ test_function (int (*my_printf) (const char *, ...))
   /* Negative zero.  */
   my_printf ("%f %d\n", -0.0, 33, 44, 55);
 
-  /* NaN.  */
-  my_printf ("%f %d\n", NaN (), 33, 44, 55);
-
   /* FLAG_ZERO.  */
   my_printf ("%015f %d\n", 1234.0, 33, 44, 55);
 
@@ -112,11 +89,6 @@ test_function (int (*my_printf) (const char *, ...))
   /* Negative zero.  */
   my_printf ("%Lf %d\n", -0.0L, 33, 44, 55);
 
-  { /* NaN.  */
-    static long double zero = 0.0L;
-    my_printf ("%Lf %d\n", zero / zero, 33, 44, 55);
-  }
-
   /* FLAG_ZERO.  */
   my_printf ("%015Lf %d\n", 1234.0L, 33, 44, 55);
 
@@ -140,9 +112,6 @@ test_function (int (*my_printf) (const char *, ...))
   /* Negative zero.  */
   my_printf ("%F %d\n", -0.0, 33, 44, 55);
 
-  /* NaN.  */
-  my_printf ("%F %d\n", NaN (), 33, 44, 55);
-
   /* FLAG_ZERO.  */
   my_printf ("%015F %d\n", 1234.0, 33, 44, 55);
 
@@ -164,11 +133,6 @@ test_function (int (*my_printf) (const char *, ...))
   /* Negative zero.  */
   my_printf ("%LF %d\n", -0.0L, 33, 44, 55);
 
-  { /* NaN.  */
-    static long double zero = 0.0L;
-    my_printf ("%LF %d\n", zero / zero, 33, 44, 55);
-  }
-
   /* FLAG_ZERO.  */
   my_printf ("%015LF %d\n", 1234.0L, 33, 44, 55);
 
index b02f35f..937ff1a 100644 (file)
@@ -5,15 +5,12 @@
 -0x0p+0 33
 inf 33
 -inf 33
-nan 33
        inf 33
-       nan 33
 12.750000 33
 1234567.000000 33
 -0.031250 33
 0.000000 33
 -0.000000 33
-nan 33
 00001234.000000 33
 1234 33
 12.750000 33
@@ -21,7 +18,6 @@ nan 33
 -0.031250 33
 0.000000 33
 -0.000000 33
-nan 33
 00001234.000000 33
 1234 33
 12.750000 33
@@ -29,7 +25,6 @@ nan 33
 -0.031250 33
 0.000000 33
 -0.000000 33
-NAN 33
 00001234.000000 33
 1234 33
 12.750000 33
@@ -37,7 +32,6 @@ NAN 33
 -0.031250 33
 0.000000 33
 -0.000000 33
-NAN 33
 00001234.000000 33
 1234 33
 55 33