diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2012-05-17 08:49:19 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-05-17 08:50:41 -0400 |
commit | 0af797def371ceb4f05586d7bcd25841653d2082 (patch) | |
tree | 3aa5591836c95fba6b694fb45c1421bf0025de91 /math/bug-nextafter.c | |
parent | e39745ffa030f685fbba13534a3023d52a27ead8 (diff) | |
download | glibc-0af797def371ceb4f05586d7bcd25841653d2082.zip glibc-0af797def371ceb4f05586d7bcd25841653d2082.tar.gz glibc-0af797def371ceb4f05586d7bcd25841653d2082.tar.bz2 |
math: support platforms with limited FP rounding or exception support
For some tests, just claim that fetestexcept() always returns true,
so the rest of the test can be compiled.
For libm-test, provide known bogus values for unsupported rounding
modes, so fesetround() will return failure.
Elsewhere, just add some #ifdefs to avoid code that uses particular
FP exceptions if the exceptions aren't supported.
Diffstat (limited to 'math/bug-nextafter.c')
-rw-r--r-- | math/bug-nextafter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/math/bug-nextafter.c b/math/bug-nextafter.c index 1d21841..558b158 100644 --- a/math/bug-nextafter.c +++ b/math/bug-nextafter.c @@ -4,6 +4,12 @@ #include <stdlib.h> #include <stdio.h> +#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW) +/* If there's no support for the exceptions this test is checking, + then just return success and allow the test to be compiled. */ +# define fetestexcept(e) 1 +#endif + float zero = 0.0; float inf = INFINITY; |