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.22-502-ge3a0002


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  e3a0002094417b331993f46064924862b17811c0 (commit)
      from  6fdd5d65c58e8c98960aa2249b1fb1546e2c256a (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=e3a0002094417b331993f46064924862b17811c0

commit e3a0002094417b331993f46064924862b17811c0
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Nov 4 21:30:26 2015 +0000

    Refactor libm-test inline tests disabling.
    
    This patch refactors how libm-test.inc handles disabling
    errno/exception handling tests, and some other tests, for
    __FAST_MATH__ inline function tests.
    
    The macro TEST_INLINE is changed from being defined/undefined to being
    defined to 1 or 0, so that it can be tested in "if" conditionals
    instead of #if.  For tests of errno and exception setting, separate
    macros TEST_ERRNO and TEST_EXCEPTIONS are added, and TEST_ERRNO is
    also used in the disabling of errno testing for vector function
    tests.  The relevant conditionals are moved up a function, so that
    they take effect before the code that counts the number of tests, so
    the inline function tests now accurately report that 0 tests for
    exceptions and errno were executed (whereas they previously reported a
    large number desipte not running any such tests).
    
    Tested for x86_64 and x86.
    
    	* math/test-math-errno.h: New file.
    	* math/test-math-inline.h (TEST_INLINE): Define to 1 instead of
    	empty.
    	(TEST_ERRNO): New macro.
    	(TEST_EXCEPTIONS): Likewise.
    	* math/test-math-no-inline.h (TEST_INLINE): Likewise.
    	(TEST_EXCEPTIONS): Likewise.
    	* math/test-math-vector.h (TEST_ERRNO): Likewise.
    	* math/test-double.c: Include "test-math-errno.h".
    	* math/test-float.c: Likewise.
    	* math/test-ldouble.c: Likewise.
    	* math/libm-test.inc (test_single_exception) [!TEST_INLINE]: Make
    	code unconditional.
    	(test_exceptions): Only run code if TEST_EXCEPTIONS.
    	(test_single_errno) [!TEST_INLINE && !TEST_MATHVEC]: Make code
    	unconditional.
    	(test_errno): Only run code if TEST_ERRNO.
    	(enable_test): Use "if" conditional on TEST_INLINE, not #ifdef.

diff --git a/ChangeLog b/ChangeLog
index b958f2c..eb29519 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2015-11-04  Joseph Myers  <joseph@codesourcery.com>
+
+	* math/test-math-errno.h: New file.
+	* math/test-math-inline.h (TEST_INLINE): Define to 1 instead of
+	empty.
+	(TEST_ERRNO): New macro.
+	(TEST_EXCEPTIONS): Likewise.
+	* math/test-math-no-inline.h (TEST_INLINE): Likewise.
+	(TEST_EXCEPTIONS): Likewise.
+	* math/test-math-vector.h (TEST_ERRNO): Likewise.
+	* math/test-double.c: Include "test-math-errno.h".
+	* math/test-float.c: Likewise.
+	* math/test-ldouble.c: Likewise.
+	* math/libm-test.inc (test_single_exception) [!TEST_INLINE]: Make
+	code unconditional.
+	(test_exceptions): Only run code if TEST_EXCEPTIONS.
+	(test_single_errno) [!TEST_INLINE && !TEST_MATHVEC]: Make code
+	unconditional.
+	(test_errno): Only run code if TEST_ERRNO.
+	(enable_test): Use "if" conditional on TEST_INLINE, not #ifdef.
+
 2015-11-04  Florian Weimer  <fweimer@redhat.com>
 
 	* nptl/tst-once5.cc: Remove attribution.
diff --git a/math/libm-test.inc b/math/libm-test.inc
index e18785f..2f0d6d9 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -608,7 +608,6 @@ test_single_exception (const char *test_name,
 		       int fe_flag,
 		       const char *flag_name)
 {
-# ifndef TEST_INLINE
   int ok = 1;
   if (exception & exc_flag)
     {
@@ -643,8 +642,6 @@ test_single_exception (const char *test_name,
     }
   if (!ok)
     ++noErrors;
-
-# endif
 }
 #endif
 
@@ -654,7 +651,7 @@ test_single_exception (const char *test_name,
 static void
 test_exceptions (const char *test_name, int exception)
 {
-  if (EXCEPTION_TESTS (FLOAT))
+  if (TEST_EXCEPTIONS && EXCEPTION_TESTS (FLOAT))
     {
       ++noExcTests;
 #ifdef FE_DIVBYZERO
@@ -694,7 +691,6 @@ static void
 test_single_errno (const char *test_name, int errno_value,
 		   int expected_value, const char *expected_name)
 {
-#if !defined TEST_INLINE && !TEST_MATHVEC
   if (errno_value == expected_value)
     {
       if (print_screen (1))
@@ -708,7 +704,6 @@ test_single_errno (const char *test_name, int errno_value,
 	printf ("Failure: %s: errno set to %d, expected %d (%s)\n",
 		test_name, errno_value, expected_value, expected_name);
     }
-#endif
 }
 
 /* Test whether errno (value ERRNO_VALUE) has been for TEST_NAME set
@@ -716,13 +711,16 @@ test_single_errno (const char *test_name, int errno_value,
 static void
 test_errno (const char *test_name, int errno_value, int exceptions)
 {
-  ++noErrnoTests;
-  if (exceptions & ERRNO_UNCHANGED)
-    test_single_errno (test_name, errno_value, 0, "unchanged");
-  if (exceptions & ERRNO_EDOM)
-    test_single_errno (test_name, errno_value, EDOM, "EDOM");
-  if (exceptions & ERRNO_ERANGE)
-    test_single_errno (test_name, errno_value, ERANGE, "ERANGE");
+  if (TEST_ERRNO)
+    {
+      ++noErrnoTests;
+      if (exceptions & ERRNO_UNCHANGED)
+	test_single_errno (test_name, errno_value, 0, "unchanged");
+      if (exceptions & ERRNO_EDOM)
+	test_single_errno (test_name, errno_value, EDOM, "EDOM");
+      if (exceptions & ERRNO_ERANGE)
+	test_single_errno (test_name, errno_value, ERANGE, "ERANGE");
+    }
 }
 
 /* Returns the number of ulps that GIVEN is away from EXPECTED.  */
@@ -1041,10 +1039,8 @@ enable_test (int exceptions)
 {
   if (exceptions & XFAIL_TEST)
     return 0;
-#ifdef TEST_INLINE
-  if (exceptions & NO_TEST_INLINE)
+  if (TEST_INLINE && (exceptions & NO_TEST_INLINE))
     return 0;
-#endif
   return 1;
 }
 
diff --git a/math/test-double.c b/math/test-double.c
index b62e433..caffe20 100644
--- a/math/test-double.c
+++ b/math/test-double.c
@@ -18,6 +18,7 @@
 
 #include "test-double.h"
 #include "test-math-no-inline.h"
+#include "test-math-errno.h"
 #include "test-math-scalar.h"
 
 #define TEST_MSG "testing double (without inline functions)\n"
diff --git a/math/test-float.c b/math/test-float.c
index b6a41c0..cb6b22d 100644
--- a/math/test-float.c
+++ b/math/test-float.c
@@ -18,6 +18,7 @@
 
 #include "test-float.h"
 #include "test-math-no-inline.h"
+#include "test-math-errno.h"
 #include "test-math-scalar.h"
 
 #define TEST_MSG "testing float (without inline functions)\n"
diff --git a/math/test-ldouble.c b/math/test-ldouble.c
index 6820c5d..4da4a4f 100644
--- a/math/test-ldouble.c
+++ b/math/test-ldouble.c
@@ -18,6 +18,7 @@
 
 #include "test-ldouble.h"
 #include "test-math-no-inline.h"
+#include "test-math-errno.h"
 #include "test-math-scalar.h"
 
 #define TEST_MSG "testing long double (without inline functions)\n"
diff --git a/math/test-math-no-inline.h b/math/test-math-errno.h
similarity index 80%
copy from math/test-math-no-inline.h
copy to math/test-math-errno.h
index ad765da..9be4a6a 100644
--- a/math/test-math-no-inline.h
+++ b/math/test-math-errno.h
@@ -1,5 +1,5 @@
-/* Common definitions for libm tests for non-inline functions.
-   Copyright (C) 1997-2015 Free Software Foundation, Inc.
+/* Common definitions for libm tests for functions setting errno.
+   Copyright (C) 2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,6 +16,4 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef __NO_MATH_INLINES
-# define __NO_MATH_INLINES
-#endif
+#define TEST_ERRNO 1
diff --git a/math/test-math-inline.h b/math/test-math-inline.h
index d778cc7..4083f70 100644
--- a/math/test-math-inline.h
+++ b/math/test-math-inline.h
@@ -16,7 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define TEST_INLINE
+#define TEST_INLINE 1
+#define TEST_ERRNO 0
+#define TEST_EXCEPTIONS 0
 
 #ifdef __NO_MATH_INLINES
 # undef __NO_MATH_INLINES
diff --git a/math/test-math-no-inline.h b/math/test-math-no-inline.h
index ad765da..87b7094 100644
--- a/math/test-math-no-inline.h
+++ b/math/test-math-no-inline.h
@@ -16,6 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#define TEST_INLINE 0
+#define TEST_EXCEPTIONS 1
+
 #ifndef __NO_MATH_INLINES
 # define __NO_MATH_INLINES
 #endif
diff --git a/math/test-math-vector.h b/math/test-math-vector.h
index 1b74841..ec4c533 100644
--- a/math/test-math-vector.h
+++ b/math/test-math-vector.h
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #define TEST_MATHVEC 1
+#define TEST_ERRNO 0
 
 #define CNCT(x, y) x ## y
 #define CONCAT(a, b) CNCT (a, b)

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

Summary of changes:
 ChangeLog                                          |   21 +++++++++++++++
 math/libm-test.inc                                 |   28 ++++++++-----------
 math/test-double.c                                 |    1 +
 math/test-float.c                                  |    1 +
 math/test-ldouble.c                                |    1 +
 .../bench-wcscat.c => math/test-math-errno.h       |    5 +--
 math/test-math-inline.h                            |    4 ++-
 math/test-math-no-inline.h                         |    3 ++
 math/test-math-vector.h                            |    1 +
 9 files changed, 45 insertions(+), 20 deletions(-)
 copy benchtests/bench-wcscat.c => math/test-math-errno.h (90%)


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]