aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorWilco <wdijkstr@arm.com>2014-04-17 09:39:27 +0100
committerMarcus Shawcroft <marcus.shawcroft@arm.com>2014-04-17 09:39:27 +0100
commit423a7160af7fcffc61aac5e2e36d0b6b5b083214 (patch)
tree60c8106d43182fefe342b49ac6d9649c767078ce /math
parentbc93ab2946efe008bb0ce2d4d3c212bd01384fca (diff)
downloadglibc-423a7160af7fcffc61aac5e2e36d0b6b5b083214.tar
glibc-423a7160af7fcffc61aac5e2e36d0b6b5b083214.tar.gz
glibc-423a7160af7fcffc61aac5e2e36d0b6b5b083214.tar.bz2
glibc-423a7160af7fcffc61aac5e2e36d0b6b5b083214.zip
Add fenv test support for targets which don't have FP traps.
Diffstat (limited to 'math')
-rw-r--r--math/test-fenv.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/math/test-fenv.c b/math/test-fenv.c
index 73cd1a7fb8..23e47d4f36 100644
--- a/math/test-fenv.c
+++ b/math/test-fenv.c
@@ -36,6 +36,7 @@
#include <unistd.h>
#include <sys/wait.h>
#include <sys/resource.h>
+#include <math-tests.h>
/*
Since not all architectures might define all exceptions, we define
@@ -233,14 +234,9 @@ feenv_nomask_test (const char *flag_name, int fe_exc)
#if defined FE_NOMASK_ENV
int status;
pid_t pid;
- fenv_t saved;
- fegetenv (&saved);
- errno = 0;
- fesetenv (FE_NOMASK_ENV);
- status = errno;
- fesetenv (&saved);
- if (status == ENOSYS)
+ if (!EXCEPTION_ENABLE_SUPPORTED (FE_ALL_EXCEPT)
+ && fesetenv (FE_NOMASK_ENV) != 0)
{
printf ("Test: not testing FE_NOMASK_ENV, it isn't implemented.\n");
return;
@@ -349,7 +345,13 @@ feexcp_nomask_test (const char *flag_name, int fe_exc)
int status;
pid_t pid;
- printf ("Test: after fedisableexcept (%s) processes will abort\n",
+ if (!EXCEPTION_ENABLE_SUPPORTED (fe_exc) && feenableexcept (fe_exc) == -1)
+ {
+ printf ("Test: not testing feenableexcept, it isn't implemented.\n");
+ return;
+ }
+
+ printf ("Test: after feenableexcept (%s) processes will abort\n",
flag_name);
printf (" when feraiseexcept (%s) is called.\n", flag_name);
pid = fork ();
@@ -470,7 +472,6 @@ feenable_test (const char *flag_name, int fe_exc)
{
int excepts;
-
printf ("Tests for feenableexcepts etc. with flag %s\n", flag_name);
/* First disable all exceptions. */
@@ -488,8 +489,12 @@ feenable_test (const char *flag_name, int fe_exc)
flag_name, excepts);
++count_errors;
}
-
excepts = feenableexcept (fe_exc);
+ if (!EXCEPTION_ENABLE_SUPPORTED (fe_exc) && excepts == -1)
+ {
+ printf ("Test: not testing feenableexcept, it isn't implemented.\n");
+ return;
+ }
if (excepts == -1)
{
printf ("Test: feenableexcept (%s) failed\n", flag_name);