about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-01-03 18:45:28 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-01-03 18:45:28 +0000
commitdaaff5cc793acdd4f8667fca3b901647b4c34363 (patch)
tree620bf804f65785149b2b9d4ce01bf90b689c2cf6 /math
parent8dad72997af2be0dc72a4bc7dbe82d85c90334fc (diff)
downloadglibc-daaff5cc793acdd4f8667fca3b901647b4c34363.tar.gz
glibc-daaff5cc793acdd4f8667fca3b901647b4c34363.tar.xz
glibc-daaff5cc793acdd4f8667fca3b901647b4c34363.zip
Fix math/test-fenvinline for no-exceptions configurations.
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).
Diffstat (limited to 'math')
-rw-r--r--math/test-fenvinline.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/math/test-fenvinline.c b/math/test-fenvinline.c
index 38964ef830..8fdfb38d13 100644
--- a/math/test-fenvinline.c
+++ b/math/test-fenvinline.c
@@ -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 ();