about summary refs log tree commit diff
path: root/math/bug-nextafter.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2012-05-17 08:49:19 -0400
committerChris Metcalf <cmetcalf@tilera.com>2012-05-17 08:50:41 -0400
commit0af797def371ceb4f05586d7bcd25841653d2082 (patch)
tree3aa5591836c95fba6b694fb45c1421bf0025de91 /math/bug-nextafter.c
parente39745ffa030f685fbba13534a3023d52a27ead8 (diff)
downloadglibc-0af797def371ceb4f05586d7bcd25841653d2082.tar.gz
glibc-0af797def371ceb4f05586d7bcd25841653d2082.tar.xz
glibc-0af797def371ceb4f05586d7bcd25841653d2082.zip
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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/math/bug-nextafter.c b/math/bug-nextafter.c
index 1d21841ea6..558b158391 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;