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.17-791-gf1d73d3


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  f1d73d30dfe6b5ebec071542835f1b6c2b2f8fcf (commit)
      from  94aca5e740d6101f91002d027776252340f6abef (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=f1d73d30dfe6b5ebec071542835f1b6c2b2f8fcf

commit f1d73d30dfe6b5ebec071542835f1b6c2b2f8fcf
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Jun 11 15:44:31 2013 +0000

    Add exception information to math-tests.h and use it in libm-test.inc.

diff --git a/ChangeLog b/ChangeLog
index 3a451b4..af730b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-06-11  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/generic/math-tests.h (EXCEPTION_TESTS_float): New macro.
+	(EXCEPTION_TESTS_double): Likewise.
+	(EXCEPTION_TESTS_long_double): Likewise.
+	(EXCEPTION_TESTS): Likewise.
+	* math/libm-test.inc (test_exceptions): Only test exceptions if
+	EXCEPTION_TESTS (FLOAT).
+
 2013-06-11  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* benchtests/Makefile (string-bench): Add strcpy_chk and
diff --git a/math/libm-test.inc b/math/libm-test.inc
index ed050cb..088bf51 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -591,33 +591,37 @@ test_single_exception (const char *test_name,
 static void
 test_exceptions (const char *test_name, int exception)
 {
-  ++noExcTests;
+  if (EXCEPTION_TESTS (FLOAT))
+    {
+      ++noExcTests;
 #ifdef FE_DIVBYZERO
-  if ((exception & DIVIDE_BY_ZERO_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception,
-			   DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
-			   "Divide by zero");
+      if ((exception & DIVIDE_BY_ZERO_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception,
+			       DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
+			       "Divide by zero");
 #endif
 #ifdef FE_INVALID
-  if ((exception & INVALID_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception, INVALID_EXCEPTION, FE_INVALID,
-			 "Invalid operation");
+      if ((exception & INVALID_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception,
+			       INVALID_EXCEPTION, FE_INVALID,
+			       "Invalid operation");
 #endif
 #ifdef FE_OVERFLOW
-  if ((exception & OVERFLOW_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
-			   FE_OVERFLOW, "Overflow");
+      if ((exception & OVERFLOW_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
+			       FE_OVERFLOW, "Overflow");
 #endif
 #ifdef FE_UNDERFLOW
-  if ((exception & UNDERFLOW_EXCEPTION_OK) == 0)
-    test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
-			   FE_UNDERFLOW, "Underflow");
+      if ((exception & UNDERFLOW_EXCEPTION_OK) == 0)
+	test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
+			       FE_UNDERFLOW, "Underflow");
 #endif
 #ifdef FE_INEXACT
-  if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0)
-    test_single_exception (test_name, exception, INEXACT_EXCEPTION,
-			   FE_INEXACT, "Inexact");
+      if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0)
+	test_single_exception (test_name, exception, INEXACT_EXCEPTION,
+			       FE_INEXACT, "Inexact");
 #endif
+    }
   feclearexcept (FE_ALL_EXCEPT);
 }
 
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 6b0310b..28ebfdf 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,10 @@
+2013-06-11  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/math-tests.h [__SOFTFP__] (EXCEPTION_TESTS_float):
+	Define to 0.
+	[__SOFTFP__] (EXCEPTION_TESTS_double): Likewise.
+	[__SOFTFP__] (EXCEPTION_TESTS_long_double): Likewise.
+
 2013-06-10  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/math-tests.h: New file.
diff --git a/ports/sysdeps/arm/math-tests.h b/ports/sysdeps/arm/math-tests.h
index 6b8e089..6fd17ed 100644
--- a/ports/sysdeps/arm/math-tests.h
+++ b/ports/sysdeps/arm/math-tests.h
@@ -18,11 +18,15 @@
 
 /* On systems with VFP support, but where glibc is built for
    soft-float, the libgcc functions used in libc and libm do not
-   support rounding modes, although fesetround succeeds.  */
+   support rounding modes, although fesetround succeeds, and do not
+   support exceptions.  */
 #ifdef __SOFTFP__
 # define ROUNDING_TESTS_float(MODE)	((MODE) == FE_TONEAREST)
 # define ROUNDING_TESTS_double(MODE)	((MODE) == FE_TONEAREST)
 # define ROUNDING_TESTS_long_double(MODE)	((MODE) == FE_TONEAREST)
+# define EXCEPTION_TESTS_float	0
+# define EXCEPTION_TESTS_double	0
+# define EXCEPTION_TESTS_long_double	0
 #endif
 
 #include_next <math-tests.h>
diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h
index b1e9fd7..89b2260 100644
--- a/sysdeps/generic/math-tests.h
+++ b/sysdeps/generic/math-tests.h
@@ -58,3 +58,21 @@
   (sizeof (TYPE) == sizeof (float) ? ROUNDING_TESTS_float (MODE)	\
    : sizeof (TYPE) == sizeof (double) ? ROUNDING_TESTS_double (MODE)	\
    : ROUNDING_TESTS_long_double (MODE))
+
+/* Indicate whether to run tests of floating-point exceptions for a
+   given floating-point type, given that the exception macros are
+   defined.  All are run unless overridden.  */
+#ifndef EXCEPTION_TESTS_float
+# define EXCEPTION_TESTS_float	1
+#endif
+#ifndef EXCEPTION_TESTS_double
+# define EXCEPTION_TESTS_double	1
+#endif
+#ifndef EXCEPTION_TESTS_long_double
+# define EXCEPTION_TESTS_long_double	1
+#endif
+
+#define EXCEPTION_TESTS(TYPE)					\
+  (sizeof (TYPE) == sizeof (float) ? EXCEPTION_TESTS_float	\
+   : sizeof (TYPE) == sizeof (double) ? EXCEPTION_TESTS_double	\
+   : EXCEPTION_TESTS_long_double)

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

Summary of changes:
 ChangeLog                      |    9 +++++++++
 math/libm-test.inc             |   38 +++++++++++++++++++++-----------------
 ports/ChangeLog.arm            |    7 +++++++
 ports/sysdeps/arm/math-tests.h |    6 +++++-
 sysdeps/generic/math-tests.h   |   18 ++++++++++++++++++
 5 files changed, 60 insertions(+), 18 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]