]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Handle narrowing function sNaN test disabling based on argument format.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 9 Feb 2018 22:56:35 +0000 (22:56 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 9 Feb 2018 22:56:35 +0000 (22:56 +0000)
Testing narrowing functions for x86_64 with GCC 6 showed up a further
testsuite fix needed: there is no _Float128 sNaN support before GCC 7
on x86_64 / x86, and the existing tests of SNAN_TESTS only checked it
for the return type, not for the argument type.  This patch fixes the
code to check SNAN_TESTS (ARG_FLOAT) as well (in a variable set in
libm-test-driver.c, since libm-test-support.c is compiled only once
for each choice of FLOAT).

Tested for x86_64 and x86 with GCC 6 in conjunction with the main
patch adding narrowing add functions.

* math/libm-test-driver.c (snan_tests_arg): New variable.
* math/libm-test-support.h (snan_tests_arg): New declaration.
* math/libm-test-support.c (enable_test): Check snan_tests_arg.

ChangeLog
math/libm-test-driver.c
math/libm-test-support.c
math/libm-test-support.h

index 4fe83a6b7fbbf70b7650c7fc404658c04f6334ef..2063f7399b97e38b86037d99d4f2aa35509228ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2018-02-09  Joseph Myers  <joseph@codesourcery.com>
 
+       * math/libm-test-driver.c (snan_tests_arg): New variable.
+       * math/libm-test-support.h (snan_tests_arg): New declaration.
+       * math/libm-test-support.c (enable_test): Check snan_tests_arg.
+
        * math/Makefile (test-type-pairs): New variable.
        (test-type-pairs-f64xf128-yes): Likewise.
        (tests): Add test-narrow-macros.
index 3713e7074f9fc4b934f920f4b29aeee07bb5677a..30646da862b2b6c7cba282299e7d7f592f3d8108 100644 (file)
@@ -27,6 +27,12 @@ const int flag_test_finite = TEST_FINITE;
 const int flag_test_inline = TEST_INLINE;
 const int flag_test_mathvec = TEST_MATHVEC;
 
+#if TEST_NARROW
+const int snan_tests_arg = SNAN_TESTS (ARG_FLOAT);
+#else
+const int snan_tests_arg = SNAN_TESTS (FLOAT);
+#endif
+
 #define STRX(x) #x
 #define STR(x) STRX (x)
 #define STR_FLOAT STR (FLOAT)
index e59f15b4d9829200101130bc17c39f82add0d113..1a12ed6a393d75121799eb35a5cb0933022d1f04 100644 (file)
@@ -985,7 +985,8 @@ enable_test (int exceptions)
     return 0;
   if (flag_test_finite && (exceptions & NON_FINITE) != 0)
     return 0;
-  if (!SNAN_TESTS (FLOAT) && (exceptions & TEST_SNAN) != 0)
+  if ((!SNAN_TESTS (FLOAT) || !snan_tests_arg)
+      && (exceptions & TEST_SNAN) != 0)
     return 0;
   if (flag_test_mathvec && (exceptions & NO_TEST_MATHVEC) != 0)
     return 0;
index 64206ab7fafe01eac2e04f9b39b45ab2975e99ec..42637741abe9687b68efae8a34fbb14348ecdef0 100644 (file)
@@ -37,6 +37,7 @@ extern const int flag_test_exceptions;
 extern const int flag_test_finite;
 extern const int flag_test_inline;
 extern const int flag_test_mathvec;
+extern const int snan_tests_arg;
 extern const char test_msg[];
 extern const char qtype_str[];
 extern const char doc[];