about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc38
1 files changed, 21 insertions, 17 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index ed050cb9ed..088bf5123e 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -591,33 +591,37 @@ test_single_exception (const char *test_name,
 static void
 test_exceptions (const char *test_name, int exception)
 {
-  ++noExcTests;
+  if (EXCEPTION_TESTS (FLOAT))
+    {
+      ++noExcTests;
 #ifdef FE_DIVBYZERO
-  if ((exception & DIVIDE_BY_ZERO_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception,
-			   DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
-			   "Divide by zero");
+      if ((exception & DIVIDE_BY_ZERO_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception,
+			       DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
+			       "Divide by zero");
 #endif
 #ifdef FE_INVALID
-  if ((exception & INVALID_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception, INVALID_EXCEPTION, FE_INVALID,
-			 "Invalid operation");
+      if ((exception & INVALID_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception,
+			       INVALID_EXCEPTION, FE_INVALID,
+			       "Invalid operation");
 #endif
 #ifdef FE_OVERFLOW
-  if ((exception & OVERFLOW_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
-			   FE_OVERFLOW, "Overflow");
+      if ((exception & OVERFLOW_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
+			       FE_OVERFLOW, "Overflow");
 #endif
 #ifdef FE_UNDERFLOW
-  if ((exception & UNDERFLOW_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
-			   FE_UNDERFLOW, "Underflow");
+      if ((exception & UNDERFLOW_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
+			       FE_UNDERFLOW, "Underflow");
 #endif
 #ifdef FE_INEXACT
-  if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0)
-    test_single_exception (test_name, exception, INEXACT_EXCEPTION,
-			   FE_INEXACT, "Inexact");
+      if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0)
+	test_single_exception (test_name, exception, INEXACT_EXCEPTION,
+			       FE_INEXACT, "Inexact");
 #endif
+    }
   feclearexcept (FE_ALL_EXCEPT);
 }