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 /stdlib | |
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 'stdlib')
-rw-r--r-- | stdlib/bug-getcontext.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/bug-getcontext.c b/stdlib/bug-getcontext.c index 745aa1f..7db49c8 100644 --- a/stdlib/bug-getcontext.c +++ b/stdlib/bug-getcontext.c @@ -9,6 +9,9 @@ static int do_test (void) { +#if FE_ALL_EXCEPT == 0 + printf("Skipping test; no support for FP exceptions.\n"); +#else int except_mask = FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW; int status = feenableexcept (except_mask); @@ -41,6 +44,7 @@ do_test (void) printf("\nAt end fegetexcept() returned %d, expected: %d.\n", mask, except_mask); +#endif return 0; } |