1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

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.
This commit is contained in:
Chris Metcalf
2012-05-17 08:49:19 -04:00
parent e39745ffa0
commit 0af797def3
7 changed files with 53 additions and 0 deletions

View File

@@ -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;
}