This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


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

Use math-tests.h more in math/test-misc


This patch makes math/test-misc.c use ROUNDING_TESTS to determine
whether to expect the tests of conversion from long double to double
to pass.  (Because two types are involved, it tests ROUNDING_TESTS for
both long double and double.)  Tested MIPS64, a case where the
previous uses of math-tests.h macros were insufficient to avoid this
test failing because of known software floating-point limitations; now
the test passes.

2013-06-16  Joseph Myers  <joseph@codesourcery.com>

	* math/test-misc.c (main): Do not treat incorrectly rounded
	conversions as failure unless ROUNDING_TESTS passes.

diff --git a/math/test-misc.c b/math/test-misc.c
index 94c7c15..390415a 100644
--- a/math/test-misc.c
+++ b/math/test-misc.c
@@ -1306,7 +1306,11 @@ main (void)
 	    {
 	      printf ("%La incorrectly rounded to %s as %a\n",
 		      ld5 * i, mstr, d5);
-	      result = 1;
+	      if (ROUNDING_TESTS (long double, mode)
+		  && ROUNDING_TESTS (double, mode))
+		result = 1;
+	      else
+		puts ("ignoring this failure");
 	    }
 	}
     }
@@ -1322,7 +1326,11 @@ main (void)
   if (d7 != nextafter (0.0, 1.0))
     {
       printf ("%La incorrectly rounded upward to %a\n", ld7, d7);
-      result = 1;
+      if (ROUNDING_TESTS (long double, FE_UPWARD)
+	  && ROUNDING_TESTS (double, FE_UPWARD))
+	result = 1;
+      else
+	puts ("ignoring this failure");
     }
 #endif
 

-- 
Joseph S. Myers
joseph@codesourcery.com


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