diff options
author | das <das@FreeBSD.org> | 2007-12-09 20:16:48 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2007-12-09 20:16:48 +0000 |
commit | faeb9466cb7cf4379691e947144a7f280b5f8024 (patch) | |
tree | 463baa72d36d39527b50f41d1cda7bbe1d46660a /tools/regression | |
parent | 8b2f43475d885e4eeb18201bf6f52eb574488739 (diff) | |
download | FreeBSD-src-faeb9466cb7cf4379691e947144a7f280b5f8024.zip FreeBSD-src-faeb9466cb7cf4379691e947144a7f280b5f8024.tar.gz |
gcc 4 does some overzealous constant folding, and since it doesn't
support FENV_ACCESS, that was causing this test to fail. Use a volatile
to avoid the constant folding.
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/lib/msun/test-lround.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/regression/lib/msun/test-lround.c b/tools/regression/lib/msun/test-lround.c index 4904abe..2a37367 100644 --- a/tools/regression/lib/msun/test-lround.c +++ b/tools/regression/lib/msun/test-lround.c @@ -37,9 +37,14 @@ __FBSDID("$FreeBSD$"); #include <math.h> #include <stdio.h> +/* + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ #define test(func, x, result, excepts) do { \ + volatile double _d = x; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert((func)(x) == (result) || fetestexcept(FE_INVALID)); \ + assert((func)(_d) == (result) || fetestexcept(FE_INVALID)); \ assert(fetestexcept(FE_ALL_EXCEPT) == (excepts)); \ } while (0) |