aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2021-04-08 11:10:58 -0400
committerPatrick Palka <ppalka@redhat.com>2021-04-08 11:10:58 -0400
commitca4641a3b536c9301a6dcb6cb2e26bd4717b47d9 (patch)
tree4999e4c0545fd7d1df37289e78455acb855ddf5b
parentd6cc745cb87aa62f9e17699aedf5aa2d9831fbd8 (diff)
downloadgcc-ca4641a3b536c9301a6dcb6cb2e26bd4717b47d9.zip
gcc-ca4641a3b536c9301a6dcb6cb2e26bd4717b47d9.tar.gz
gcc-ca4641a3b536c9301a6dcb6cb2e26bd4717b47d9.tar.bz2
libstdc++: Address remaining to_chars/long_double.cc FAILs [PR98384]
This works around the remaining reported execution FAILs of this test on AIX, Solaris and Darwin. Eventually we should rewrite this test to be less fragile, but there's not enough time to do that for GCC 11. libstdc++-v3/ChangeLog: PR libstdc++/98384 * testsuite/20_util/to_chars/long_double.cc: Don't run the test on targets without a large long double. XFAIL the execution on targets with a non-conforming printf.
-rw-r--r--libstdc++-v3/testsuite/20_util/to_chars/long_double.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc b/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc
index 5c1f713..22d4206 100644
--- a/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc
+++ b/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc
@@ -17,7 +17,23 @@
// <charconv> is supported in C++14 as a GNU extension, but this test uses C++17
// hexadecimal floating-point literals.
-// { dg-do run { target c++17 } }
+
+// When long double is larger than double, the long double to_chars overloads
+// are partially implemented in terms of printf, so this test in turn uses
+// printf to verify correctness these overloads.
+// When long double == double, the long double to_chars overloads are simple
+// wrappers around the corresponding double overloads. Since they don't go
+// through printf, we can't portably verify their output by comparing it with
+// that of printf, so it's simplest to just not run this test on such targets;
+// correctness of these overloads is already implied by that of the double
+// overloads.
+// { dg-do run { target { c++17 && large_long_double } } }
+// { dg-do compile { target { c++17 && { ! large_long_double } } } }
+
+// The system printf on these targets appear to be buggy. FIXME: Make this test
+// more portable and robust to differences in system printf behavior.
+// { dg-xfail-run-if "Non-conforming printf (see PR98384)" { *-*-solaris* *-*-darwin* } }
+
// { dg-require-effective-target ieee-floats }
#include <charconv>