summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2010-12-06 00:19:56 +0000
committerdas <das@FreeBSD.org>2010-12-06 00:19:56 +0000
commitc0634c210540e4d95655c2c05ebae344ec03bb54 (patch)
treebf93f090cabea4473a818c177ec1cdb9e7448e68 /tools
parent812571675e8fd17c6affd8cc80f0bde3cbb19d01 (diff)
downloadFreeBSD-src-c0634c210540e4d95655c2c05ebae344ec03bb54.zip
FreeBSD-src-c0634c210540e4d95655c2c05ebae344ec03bb54.tar.gz
Work around gcc constant folding bugs.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/lib/msun/test-lrint.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/regression/lib/msun/test-lrint.c b/tools/regression/lib/msun/test-lrint.c
index 1693a34a..ba099aa 100644
--- a/tools/regression/lib/msun/test-lrint.c
+++ b/tools/regression/lib/msun/test-lrint.c
@@ -41,9 +41,14 @@ __FBSDID("$FreeBSD$");
#include <ieeefp.h>
#endif
+/*
+ * 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)
OpenPOWER on IntegriCloud