From 0af797def371ceb4f05586d7bcd25841653d2082 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Thu, 17 May 2012 08:49:19 -0400 Subject: 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. --- stdlib/bug-getcontext.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'stdlib/bug-getcontext.c') diff --git a/stdlib/bug-getcontext.c b/stdlib/bug-getcontext.c index 745aa1f207..7db49c8499 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; } -- cgit 1.4.1