public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Patrick Palka <ppalka@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-8055] libstdc++: Address remaining to_chars/long_double.cc FAILs [PR98384]
Date: Thu,  8 Apr 2021 15:11:24 +0000 (GMT)	[thread overview]
Message-ID: <20210408151124.96F63394443F@sourceware.org> (raw)

https://gcc.gnu.org/g:ca4641a3b536c9301a6dcb6cb2e26bd4717b47d9

commit r11-8055-gca4641a3b536c9301a6dcb6cb2e26bd4717b47d9
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Apr 8 11:10:58 2021 -0400

    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.

Diff:
---
 libstdc++-v3/testsuite/20_util/to_chars/long_double.cc | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

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 5c1f7136f21..22d42067d65 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>


                 reply	other threads:[~2021-04-08 15:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408151124.96F63394443F@sourceware.org \
    --to=ppalka@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).