This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testcase] Re: ia64 libm update broke nextafterl


On Wed, Mar 09, 2005 at 05:43:00AM -0800, Lu, Hongjiu wrote:
> Do you have a new testcase patch for glibc? 

Sure.

2005-03-10  Jakub Jelinek  <jakub@redhat.com>

	* math/test-misc.c (main): Add some more tests.

--- libc/math/test-misc.c.jj	2005-03-10 06:01:31.000000000 -0500
+++ libc/math/test-misc.c	2005-03-10 06:13:59.000000000 -0500
@@ -1,5 +1,5 @@
 /* Miscellaneous tests which don't fit anywhere else.
-   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -1143,5 +1143,45 @@ main (void)
   }
 #endif
 
+  /* The tests here are very similar to tests earlier in this file,
+     the important difference is just that there are no intervening
+     union variables that cause some GCC versions to hide possible
+     bugs in nextafter* implementation.  */
+  if (nextafterf (nextafterf (FLT_MIN, FLT_MIN / 2.0), FLT_MIN) != FLT_MIN)
+    {
+      puts ("nextafterf FLT_MIN test failed");
+      result = 1;
+    }
+  if (nextafterf (nextafterf (-FLT_MIN, -FLT_MIN / 2.0), -FLT_MIN)
+      != -FLT_MIN)
+    {
+      puts ("nextafterf -FLT_MIN test failed");
+      result = 1;
+    }
+  if (nextafter (nextafter (DBL_MIN, DBL_MIN / 2.0), DBL_MIN) != DBL_MIN)
+    {
+      puts ("nextafter DBL_MIN test failed");
+      result = 1;
+    }
+  if (nextafter (nextafter (-DBL_MIN, -DBL_MIN / 2.0), -DBL_MIN) != -DBL_MIN)
+    {
+      puts ("nextafter -DBL_MIN test failed");
+      result = 1;
+    }
+#ifndef NO_LONG_DOUBLE
+  if (nextafterl (nextafterl (LDBL_MIN, LDBL_MIN / 2.0), LDBL_MIN)
+      != LDBL_MIN)
+    {
+      puts ("nextafterl LDBL_MIN test failed");
+      result = 1;
+    }
+  if (nextafterl (nextafterl (-LDBL_MIN, -LDBL_MIN / 2.0), -LDBL_MIN)
+      != -LDBL_MIN)
+    {
+      puts ("nextafterl -LDBL_MIN test failed");
+      result = 1;
+    }
+#endif
+
   return result;
 }

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]