GNU C Library master sources branch master updated. glibc-2.22-511-g5a28590

jsm28@sourceware.org jsm28@sourceware.org
Thu Nov 5 23:28:00 GMT 2015


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  5a28590adfc5ed898a335f7a3359a9243534eded (commit)
      from  f75226e6de9ebc40784cb5a906c97b8a68bc0c60 (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=5a28590adfc5ed898a335f7a3359a9243534eded

commit 5a28590adfc5ed898a335f7a3359a9243534eded
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Nov 5 23:28:16 2015 +0000

    Run libm-test tests for finite-math-only functions.
    
    This patch arranges for the libm-test tests to be run for the
    finite-math-only function variants, in addition to the existing runs
    for out-of-line and bits/mathinline.h inline variants.
    
    gen-libm-test.pl is made to add a flag to all tests with non-finite
    inputs or outputs so that they can be skipped at runtime when the
    finite-math-only variants are being tested (skipping is for all
    rounding modes; that is, -ffinite-math-only is being treated as
    excluding overflow cases even when the rounding mode is such that the
    overflowed result is finite).  errno setting is not tested for these
    variants (in general they don't set it, and it's
    implementation-defined in ISO C whether it's set on underflow, with
    the glibc definition being that it may not be for -ffinite-math-only;
    other cases where errno would normally be expected to be set are
    mostly excluded as having non-finite or overflowing arguments or
    results).
    
    As with the inline function tests, these ones are built with
    -D__FINITE_MATH_ONLY=1 to select the function variants, rather than
    -ffinite-math-only.  Use of -ffinite-math-only would not be suitable
    for these tests because it would also affect libm-test.inc code that
    e.g. tests whether results are infinities or NaNs - if these function
    variants have bugs that incorrectly produce such results, we want them
    to show up in the tests, which means the compiler should not be
    optimizing the tests on the basis of results being finite.
    
    The finite-math-only functions share the same ulps settings as the
    main out-of-line functions.
    
    These interfaces were one significant group of untested ABIs listed at
    <https://sourceware.org/ml/libc-alpha/2013-07/msg00386.html>.  I
    haven't rerun the script to list untested interfaces, but I expect
    that the vast bulk of interfaces there are still untested and could do
    with testcases being added (or, if applicable, being made compat
    symbols; in general, most symbols not starting '_' are safe bets to
    add tests for, while _* need more investigation of what the actual
    public API is, if any).  I'd like to encourage people to help reduce
    the accumulation of untested interfaces by adding more tests.
    
    Tested for x86_64 and x86.  Given my recent lgamma/gamma and log*
    fixes, the new tests pass (before those fixes, the new tests showed up
    those bugs, so illustrating the practical utility of having tests for
    these function variants).
    
    	* math/libm-test.inc (NON_FINITE): New macro.
    	(enable_test): Do not run tests flagged NON_FINITE if TEST_FINITE.
    	* math/gen-libm-test.pl (show_exceptions): Add argument
    	$non_finite.
    	(parse_args): Update call to show_exceptions.
    	* math/test-math-finite.h: New file.
    	* math/test-math-no-finite.h: Likewise.
    	* math/test-double-finite.c: Likewise.
    	* math/test-float-finite.c: Likewise.
    	* math/test-ldouble-finite.c: Likewise.
    	* math/test-double.c: Include "test-math-no-finite.h".
    	* math/test-float.c: Include "test-math-no-finite.h".
    	* math/test-ldouble.c: Include "test-math-no-finite.h".
    	* math/test-math-inline.h (TEST_FINITE): New macro.
    	* math/test-math-vector.h (TEST_FINITE): Likewise.
    	* math/Makefile (test-longdouble-yes): Add test-ldouble-finite.
    	(libm-tests): Add test-float-finite and test-double-finite.
    	($(objpfx)test-float-finite.o): New dependency on
    	$(objpfx)libm-test.stmp.
    	($(objpfx)test-double-finite.o): Likewise.
    	($(objpfx)test-ldouble-finite.o): Likewise.
    	(libm-test-no-inline-cflags): New variable.
    	(libm-test-finite-cflags): Likewise.
    	(CFLAGS-test-float-finite.c): Likewise.
    	(CFLAGS-test-double-finite.c): Likewise.
    	(CFLAGS-test-ldouble-finite.c): Likewise.
    	(CFLAGS-test-float.c): Use $(libm-test-no-inline-cflags).
    	(CFLAGS-test-double.c): Likewise.
    	(CFLAGS-test-ldouble.c): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 26cde5b..8cf5b0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2015-11-05  Joseph Myers  <joseph@codesourcery.com>
+
+	* math/libm-test.inc (NON_FINITE): New macro.
+	(enable_test): Do not run tests flagged NON_FINITE if TEST_FINITE.
+	* math/gen-libm-test.pl (show_exceptions): Add argument
+	$non_finite.
+	(parse_args): Update call to show_exceptions.
+	* math/test-math-finite.h: New file.
+	* math/test-math-no-finite.h: Likewise.
+	* math/test-double-finite.c: Likewise.
+	* math/test-float-finite.c: Likewise.
+	* math/test-ldouble-finite.c: Likewise.
+	* math/test-double.c: Include "test-math-no-finite.h".
+	* math/test-float.c: Include "test-math-no-finite.h".
+	* math/test-ldouble.c: Include "test-math-no-finite.h".
+	* math/test-math-inline.h (TEST_FINITE): New macro.
+	* math/test-math-vector.h (TEST_FINITE): Likewise.
+	* math/Makefile (test-longdouble-yes): Add test-ldouble-finite.
+	(libm-tests): Add test-float-finite and test-double-finite.
+	($(objpfx)test-float-finite.o): New dependency on
+	$(objpfx)libm-test.stmp.
+	($(objpfx)test-double-finite.o): Likewise.
+	($(objpfx)test-ldouble-finite.o): Likewise.
+	(libm-test-no-inline-cflags): New variable.
+	(libm-test-finite-cflags): Likewise.
+	(CFLAGS-test-float-finite.c): Likewise.
+	(CFLAGS-test-double-finite.c): Likewise.
+	(CFLAGS-test-ldouble-finite.c): Likewise.
+	(CFLAGS-test-float.c): Use $(libm-test-no-inline-cflags).
+	(CFLAGS-test-double.c): Likewise.
+	(CFLAGS-test-ldouble.c): Likewise.
+
 2015-11-05  Roland McGrath  <roland@hack.frob.com>
 
 	* io/fcntl.c (__fcntl): Add ... to prototype.
diff --git a/math/Makefile b/math/Makefile
index adeb806..ec9e6b2 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -113,12 +113,13 @@ tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
 tests-static = test-fpucw-static test-fpucw-ieee-static
 # We do the `long double' tests only if this data type is available and
 # distinct from `double'.
-test-longdouble-yes = test-ldouble test-ildoubl
+test-longdouble-yes = test-ldouble test-ildoubl test-ldouble-finite
 
 ifneq (no,$(PERL))
 libm-vec-tests = $(addprefix test-,$(libmvec-tests))
 libm-tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
-	test-ifloat test-idouble $(libm-vec-tests)
+	test-ifloat test-idouble test-float-finite test-double-finite \
+	$(libm-vec-tests)
 libm-tests.o = $(addsuffix .o,$(libm-tests))
 
 tests += $(libm-tests)
@@ -141,10 +142,13 @@ $(objpfx)libm-test.stmp: $(ulps-file) libm-test.inc gen-libm-test.pl \
 
 $(objpfx)test-float.o: $(objpfx)libm-test.stmp
 $(objpfx)test-ifloat.o: $(objpfx)libm-test.stmp
+$(objpfx)test-float-finite.o: $(objpfx)libm-test.stmp
 $(objpfx)test-double.o: $(objpfx)libm-test.stmp
 $(objpfx)test-idouble.o: $(objpfx)libm-test.stmp
+$(objpfx)test-double-finite.o: $(objpfx)libm-test.stmp
 $(objpfx)test-ldouble.o: $(objpfx)libm-test.stmp
 $(objpfx)test-ildoubl.o: $(objpfx)libm-test.stmp
+$(objpfx)test-ldouble-finite.o: $(objpfx)libm-test.stmp
 endif
 
 libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH
@@ -167,9 +171,15 @@ CFLAGS-test-float-vlen8-wrappers.c = $(float-vlen8-arch-ext-cflags)
 CFLAGS-test-float-vlen16.c = $(libm-test-vec-cflags)
 CFLAGS-test-float-vlen16-wrappers.c = $(float-vlen16-arch-ext-cflags)
 
-CFLAGS-test-float.c = -fno-inline -ffloat-store -fno-builtin
-CFLAGS-test-double.c = -fno-inline -ffloat-store -fno-builtin
-CFLAGS-test-ldouble.c = -fno-inline -ffloat-store -fno-builtin
+libm-test-no-inline-cflags = -fno-inline -ffloat-store -fno-builtin
+libm-test-finite-cflags = $(libm-test-no-inline-cflags) \
+			  -U__FINITE_MATH_ONLY__ -D__FINITE_MATH_ONLY__=1
+CFLAGS-test-float.c = $(libm-test-no-inline-cflags)
+CFLAGS-test-float-finite.c = $(libm-test-finite-cflags)
+CFLAGS-test-double.c = $(libm-test-no-inline-cflags)
+CFLAGS-test-double-finite.c = $(libm-test-finite-cflags)
+CFLAGS-test-ldouble.c = $(libm-test-no-inline-cflags)
+CFLAGS-test-ldouble-finite.c = $(libm-test-finite-cflags)
 CFLAGS-test-tgmath.c = -fno-builtin
 # The following testcase uses very long lines (>3 million), so it may take a
 # while to compile it. See: http://llvm.org/bugs/show_bug.cgi?id=14106 and
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index 9a0ada0..e1ed0b7 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -141,12 +141,13 @@ sub build_complex_beautify {
 # Return the text to put in an initializer for a test's exception
 # information.
 sub show_exceptions {
-  my ($ignore_result, $exception) = @_;
+  my ($ignore_result, $non_finite, $exception) = @_;
   $ignore_result = ($ignore_result ? "IGNORE_RESULT|" : "");
+  $non_finite = ($non_finite ? "NON_FINITE|" : "");
   if (defined $exception) {
-    return ", ${ignore_result}$exception";
+    return ", ${ignore_result}${non_finite}$exception";
   } else {
-    return ", ${ignore_result}0";
+    return ", ${ignore_result}${non_finite}0";
   }
 }
 
@@ -162,6 +163,7 @@ sub parse_args {
   my (@plus_oflow, @minus_oflow, @plus_uflow, @minus_uflow);
   my (@errno_plus_oflow, @errno_minus_oflow);
   my (@errno_plus_uflow, @errno_minus_uflow);
+  my ($non_finite);
 
   ($descr_args, $descr_res) = split /_/,$descr, 2;
 
@@ -306,8 +308,12 @@ sub parse_args {
     if ($ignore_result_any && !$ignore_result_all) {
       die ("some but not all function results ignored\n");
     }
+    # Determine whether any arguments or results, for any rounding
+    # mode, are non-finite.
+    $non_finite = ($args =~ /qnan_value|plus_infty|minus_infty/);
     # Add exceptions.
     $cline_res .= show_exceptions ($ignore_result_any,
+				   $non_finite,
 				   ($current_arg <= $#args_res)
 				   ? $args_res[$current_arg]
 				   : undef);
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 2f0d6d9..669b060 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -182,6 +182,7 @@ struct ulp_data
 #define ERRNO_ERANGE			0x10000
 /* Flags generated by gen-libm-test.pl, not entered here manually.  */
 #define IGNORE_RESULT			0x20000
+#define NON_FINITE			0x40000
 
 /* Values underflowing only for float.  */
 #ifdef TEST_FLOAT
@@ -1041,6 +1042,8 @@ enable_test (int exceptions)
     return 0;
   if (TEST_INLINE && (exceptions & NO_TEST_INLINE))
     return 0;
+  if (TEST_FINITE && (exceptions & NON_FINITE) != 0)
+    return 0;
   return 1;
 }
 
diff --git a/math/test-double.c b/math/test-double-finite.c
similarity index 87%
copy from math/test-double.c
copy to math/test-double-finite.c
index caffe20..52c3fd9 100644
--- a/math/test-double.c
+++ b/math/test-double-finite.c
@@ -1,6 +1,5 @@
 /* Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Andreas Jaeger <aj@suse.de>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,11 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "test-double.h"
+#include "test-math-finite.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"
+#define TEST_MSG "testing double (finite-math-only)\n"
 #define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cdouble
 
 #include "libm-test.c"
diff --git a/math/test-double.c b/math/test-double.c
index caffe20..594c996 100644
--- a/math/test-double.c
+++ b/math/test-double.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "test-double.h"
+#include "test-math-no-finite.h"
 #include "test-math-no-inline.h"
 #include "test-math-errno.h"
 #include "test-math-scalar.h"
diff --git a/math/test-float.c b/math/test-float-finite.c
similarity index 87%
copy from math/test-float.c
copy to math/test-float-finite.c
index cb6b22d..3587d66 100644
--- a/math/test-float.c
+++ b/math/test-float-finite.c
@@ -1,6 +1,5 @@
 /* Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Andreas Jaeger <aj@suse.de>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,11 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "test-float.h"
+#include "test-math-finite.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"
+#define TEST_MSG "testing float (finite-math-only)\n"
 #define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cfloat
 
 #include "libm-test.c"
diff --git a/math/test-float.c b/math/test-float.c
index cb6b22d..4ca81f7 100644
--- a/math/test-float.c
+++ b/math/test-float.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "test-float.h"
+#include "test-math-no-finite.h"
 #include "test-math-no-inline.h"
 #include "test-math-errno.h"
 #include "test-math-scalar.h"
diff --git a/math/test-ldouble.c b/math/test-ldouble-finite.c
similarity index 86%
copy from math/test-ldouble.c
copy to math/test-ldouble-finite.c
index 4da4a4f..ca25283 100644
--- a/math/test-ldouble.c
+++ b/math/test-ldouble-finite.c
@@ -1,6 +1,5 @@
 /* Copyright (C) 1997-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Andreas Jaeger <aj@suse.de>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,11 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "test-ldouble.h"
+#include "test-math-finite.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"
+#define TEST_MSG "testing long double (finite-math-only)\n"
 #define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Clongdouble
 
 #include "libm-test.c"
diff --git a/math/test-ldouble.c b/math/test-ldouble.c
index 4da4a4f..2450dfb 100644
--- a/math/test-ldouble.c
+++ b/math/test-ldouble.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "test-ldouble.h"
+#include "test-math-no-finite.h"
 #include "test-math-no-inline.h"
 #include "test-math-errno.h"
 #include "test-math-scalar.h"
diff --git a/math/test-math-inline.h b/math/test-math-finite.h
similarity index 77%
copy from math/test-math-inline.h
copy to math/test-math-finite.h
index 4083f70..52e87e2 100644
--- a/math/test-math-inline.h
+++ b/math/test-math-finite.h
@@ -1,5 +1,5 @@
-/* Common definitions for libm tests for inline functions.
-   Copyright (C) 1997-2015 Free Software Foundation, Inc.
+/* Common definitions for libm tests for finite-math-only.
+   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,10 +16,5 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define TEST_INLINE 1
+#define TEST_FINITE 1
 #define TEST_ERRNO 0
-#define TEST_EXCEPTIONS 0
-
-#ifdef __NO_MATH_INLINES
-# undef __NO_MATH_INLINES
-#endif
diff --git a/math/test-math-inline.h b/math/test-math-inline.h
index 4083f70..0d35005 100644
--- a/math/test-math-inline.h
+++ b/math/test-math-inline.h
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #define TEST_INLINE 1
+#define TEST_FINITE 0
 #define TEST_ERRNO 0
 #define TEST_EXCEPTIONS 0
 
diff --git a/math/test-math-inline.h b/math/test-math-no-finite.h
similarity index 74%
copy from math/test-math-inline.h
copy to math/test-math-no-finite.h
index 4083f70..d74a158 100644
--- a/math/test-math-inline.h
+++ b/math/test-math-no-finite.h
@@ -1,5 +1,5 @@
-/* Common definitions for libm tests for inline functions.
-   Copyright (C) 1997-2015 Free Software Foundation, Inc.
+/* Common definitions for libm tests for no-finite-math-only.
+   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,10 +16,4 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define TEST_INLINE 1
-#define TEST_ERRNO 0
-#define TEST_EXCEPTIONS 0
-
-#ifdef __NO_MATH_INLINES
-# undef __NO_MATH_INLINES
-#endif
+#define TEST_FINITE 0
diff --git a/math/test-math-vector.h b/math/test-math-vector.h
index ec4c533..a129016 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_FINITE 0
 #define TEST_ERRNO 0
 
 #define CNCT(x, y) x ## y

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

Summary of changes:
 ChangeLog                  |   32 ++++++++++++++++++++++++++++++++
 math/Makefile              |   20 +++++++++++++++-----
 math/gen-libm-test.pl      |   12 +++++++++---
 math/libm-test.inc         |    3 +++
 math/test-double-finite.c  |   26 ++++++++++++++++++++++++++
 math/test-double.c         |    1 +
 math/test-float-finite.c   |   26 ++++++++++++++++++++++++++
 math/test-float.c          |    1 +
 math/test-ldouble-finite.c |   26 ++++++++++++++++++++++++++
 math/test-ldouble.c        |    1 +
 math/test-math-finite.h    |   20 ++++++++++++++++++++
 math/test-math-inline.h    |    1 +
 math/test-math-no-finite.h |   19 +++++++++++++++++++
 math/test-math-vector.h    |    1 +
 14 files changed, 181 insertions(+), 8 deletions(-)
 create mode 100644 math/test-double-finite.c
 create mode 100644 math/test-float-finite.c
 create mode 100644 math/test-ldouble-finite.c
 create mode 100644 math/test-math-finite.h
 create mode 100644 math/test-math-no-finite.h


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



More information about the Glibc-cvs mailing list