From f1d73d30dfe6b5ebec071542835f1b6c2b2f8fcf Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 11 Jun 2013 15:44:31 +0000 Subject: Add exception information to math-tests.h and use it in libm-test.inc. --- math/libm-test.inc | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'math') 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); } -- cgit 1.4.1