]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix math/test-fenvinline for no-exceptions configurations.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 3 Jan 2017 18:45:28 +0000 (18:45 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 3 Jan 2017 18:45:28 +0000 (18:45 +0000)
This patch fixes math/test-fenvinline.c to stop it failing in
no-exceptions configurations (where some exception macros are defined
but may not be supported at runtime).  The relevant parts of the test
are disabled in that case; some parts can still run (and the rounding
mode tests are written in a way such that they work even if the
rounding modes aren't supported).

Tested for mips64 soft-float, and for x86_64 to make sure the tests
still run when the exceptions are supported.

* math/test-fenvinline.c (do_test): Disable tests of raised
exceptions if !EXCEPTION_TESTS (FLOAT).

ChangeLog
math/test-fenvinline.c

index 1bb6eaa5367b33f391789e683a1d8af3e1425095..70b643542b433770a250a77dfd832c9a856909a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-03  Joseph Myers  <joseph@codesourcery.com>
+
+       * math/test-fenvinline.c (do_test): Disable tests of raised
+       exceptions if !EXCEPTION_TESTS (FLOAT).
+
 2017-01-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        [BZ #19390]
index 38964ef830c92fd0a6e185b00dba45ac3e904bf7..8fdfb38d13dbeb515fd0240275fbaa07e6208de4 100644 (file)
@@ -326,8 +326,9 @@ do_test (void)
 
   /* raise all exceptions and test if all are raised  */
   feraiseexcept (FE_ALL_EXCEPT);
-  test_exceptions ("feraiseexcept (FE_ALL_EXCEPT) raises all exceptions",
-                   ALL_EXC);
+  if (EXCEPTION_TESTS (float))
+    test_exceptions ("feraiseexcept (FE_ALL_EXCEPT) raises all exceptions",
+                    ALL_EXC);
 
   /* Same test, but using double as argument  */
   feclearexcept ((double)FE_ALL_EXCEPT);
@@ -335,10 +336,12 @@ do_test (void)
                    NO_EXC);
 
   feraiseexcept ((double)FE_ALL_EXCEPT);
-  test_exceptions ("feraiseexcept ((double)FE_ALL_EXCEPT) raises all exceptions",
-                   ALL_EXC);
+  if (EXCEPTION_TESTS (float))
+    test_exceptions ("feraiseexcept ((double)FE_ALL_EXCEPT) raises all exceptions",
+                    ALL_EXC);
 
-  test_exceptionflag ();
+  if (EXCEPTION_TESTS (float))
+    test_exceptionflag ();
 
   test_fesetround ();