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.
This commit is contained in:
parent
8b2f43475d
commit
faeb9466cb
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user