Changeset View
Changeset View
Standalone View
Standalone View
lib/msun/tests/exponential_test.c
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
* meaningful error messages. | * meaningful error messages. | ||||
* | * | ||||
* XXX The volatile here is to avoid gcc's bogus constant folding and work | * XXX The volatile here is to avoid gcc's bogus constant folding and work | ||||
* around the lack of support for the FENV_ACCESS pragma. | * around the lack of support for the FENV_ACCESS pragma. | ||||
*/ | */ | ||||
#define test(func, x, result, exceptmask, excepts) do { \ | #define test(func, x, result, exceptmask, excepts) do { \ | ||||
volatile long double _d = x; \ | volatile long double _d = x; \ | ||||
ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ | ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ | ||||
ATF_CHECK(fpequal((func)(_d), (result))); \ | CHECK_FPEQUAL((func)(_d), (result)); \ | ||||
CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ | CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ | ||||
#func, #x); \ | #func, #x); \ | ||||
} while (0) | } while (0) | ||||
/* Test all the functions that compute b^x. */ | /* Test all the functions that compute b^x. */ | ||||
#define _testall0(x, result, exceptmask, excepts) do { \ | #define _testall0(x, result, exceptmask, excepts) do { \ | ||||
test(exp, x, result, exceptmask, excepts); \ | test(exp, x, result, exceptmask, excepts); \ | ||||
test(expf, x, result, exceptmask, excepts); \ | test(expf, x, result, exceptmask, excepts); \ | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |