From 3c9d4d56e68bff693a6fc1f75e1dc63bd9bce96a Mon Sep 17 00:00:00 2001 From: das Date: Sun, 2 Mar 2008 20:49:24 +0000 Subject: Don't run tests that assume <= 64-bit precision on machines with quad precision. --- tools/regression/lib/msun/test-trig.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/regression/lib/msun/test-trig.c b/tools/regression/lib/msun/test-trig.c index 2d70c89..e08c4a7 100644 --- a/tools/regression/lib/msun/test-trig.c +++ b/tools/regression/lib/msun/test-trig.c @@ -65,16 +65,23 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(fpequal((func)(_d), (result))); \ + assert(fpequal((func)(_d), (result))); \ assert(((func), fetestexcept(exceptmask) == (excepts))); \ } while (0) #define testall(prefix, x, result, exceptmask, excepts) do { \ - test(prefix, x, (double)result, exceptmask, excepts); \ + test(prefix, x, (double)result, exceptmask, excepts); \ test(prefix##f, x, (float)result, exceptmask, excepts); \ test(prefix##l, x, result, exceptmask, excepts); \ } while (0) +#define testdf(prefix, x, result, exceptmask, excepts) do { \ + test(prefix, x, (double)result, exceptmask, excepts); \ + test(prefix##f, x, (float)result, exceptmask, excepts); \ +} while (0) + + + /* * Determine whether x and y are equal, with two special rules: * +0.0 != -0.0 @@ -238,17 +245,22 @@ run_accuracy_tests(void) * These tests should pass for f32, d64, and ld80 as long as * the error is <= 0.75 ulp (round to nearest) */ - testall(sin, 0.17255452780841205174L, 0.17169949801444412683L, +#if LDBL_MANT_DIG <= 64 +#define testacc testall +#else +#define testacc testdf +#endif + testacc(sin, 0.17255452780841205174L, 0.17169949801444412683L, ALL_STD_EXCEPT, FE_INEXACT); - testall(sin, -0.75431944555904520893L, -0.68479288156557286353L, + testacc(sin, -0.75431944555904520893L, -0.68479288156557286353L, ALL_STD_EXCEPT, FE_INEXACT); - testall(cos, 0.70556358769838947292L, 0.76124620693117771850L, + testacc(cos, 0.70556358769838947292L, 0.76124620693117771850L, ALL_STD_EXCEPT, FE_INEXACT); - testall(cos, -0.34061437849088045332L, 0.94254960031831729956L, + testacc(cos, -0.34061437849088045332L, 0.94254960031831729956L, ALL_STD_EXCEPT, FE_INEXACT); - testall(tan, -0.15862817413325692897L, -0.15997221861309522115L, + testacc(tan, -0.15862817413325692897L, -0.15997221861309522115L, ALL_STD_EXCEPT, FE_INEXACT); - testall(tan, 0.38374784931303813530L, 0.40376500259976759951L, + testacc(tan, 0.38374784931303813530L, 0.40376500259976759951L, ALL_STD_EXCEPT, FE_INEXACT); /* -- cgit v1.1