This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.19-301-g423a716


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  423a7160af7fcffc61aac5e2e36d0b6b5b083214 (commit)
      from  bc93ab2946efe008bb0ce2d4d3c212bd01384fca (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=423a7160af7fcffc61aac5e2e36d0b6b5b083214

commit 423a7160af7fcffc61aac5e2e36d0b6b5b083214
Author: Wilco <wdijkstr@arm.com>
Date:   Thu Apr 17 09:39:27 2014 +0100

    Add fenv test support for targets which don't have FP traps.

diff --git a/ChangeLog b/ChangeLog
index ac40659..b8fa520 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-04-17  Wilco  <wdijkstr@arm.com>
+
+	* sysdeps/arm/math-tests.h: New file: Set ARM math-test settings.
+	* sysdeps/generic/math-tests.h: Add macro (EXCEPTION_ENABLE_SUPPORTED).
+	* math/test-fenv.c: Skip exception trap tests on targets which only
+	support non-stop mode.
+
 2014-04-17  Ian Bolton  <ian.bolton@arm.com>
 	    Wilco Dijkstra  <wilco.dijkstra@arm.com>
 
diff --git a/math/test-fenv.c b/math/test-fenv.c
index 73cd1a7..23e47d4 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);
diff --git a/sysdeps/arm/math-tests.h b/sysdeps/arm/math-tests.h
index e65f135..ea5f8dc 100644
--- a/sysdeps/arm/math-tests.h
+++ b/sysdeps/arm/math-tests.h
@@ -29,4 +29,7 @@
 # define EXCEPTION_TESTS_long_double	0
 #endif
 
+/* Not all VFP implementations support trapping exceptions.  */
+#define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)	((EXCEPT) == 0)
+
 #include_next <math-tests.h>
diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h
index c86b067..3f2bd69 100644
--- a/sysdeps/generic/math-tests.h
+++ b/sysdeps/generic/math-tests.h
@@ -76,3 +76,14 @@
   (sizeof (TYPE) == sizeof (float) ? EXCEPTION_TESTS_float	\
    : sizeof (TYPE) == sizeof (double) ? EXCEPTION_TESTS_double	\
    : EXCEPTION_TESTS_long_double)
+
+/* Indicate whether the given exception trap(s) can be enabled
+   in feenableexcept.  If non-zero, the traps are always supported.
+   If zero, traps may or may not be supported depending on the
+   target (this can be determined by checking the return value
+   of feenableexcept).  This enables skipping of tests which use
+   traps.  By default traps are supported unless overridden.  */
+#ifndef EXCEPTION_ENABLE_SUPPORTED
+# define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)			\
+   (EXCEPTION_TESTS_float || EXCEPTION_TESTS_double)
+#endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                    |    7 +++++++
 math/test-fenv.c             |   27 ++++++++++++++++-----------
 sysdeps/arm/math-tests.h     |    3 +++
 sysdeps/generic/math-tests.h |   11 +++++++++++
 4 files changed, 37 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]