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

commit r16-955-ga8e22d3fcc079c02bc2bc91d57f5877fb87f52cb
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed May 28 22:02:58 2025 +0100

    libstdc++: Fix lwg4084.cc test FAIL on AIX
    
    On AIX printf formats a quiet NaN as "NaNQ" and it doesn't matter
    whether %f or %F is used. Similarly, it always prints "INF" for
    infinity, even when %f is used. Adjust a test that currently fails due
    to this AIX-specific (and non-conforming) behaviour.
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/22_locale/num_put/put/char/lwg4084.cc [_AIX]: Adjust
            expected output for NaN and infinity.

Diff:
---
 libstdc++-v3/testsuite/22_locale/num_put/put/char/lwg4084.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/lwg4084.cc 
b/libstdc++-v3/testsuite/22_locale/num_put/put/char/lwg4084.cc
index b7c7da11f863..6ce4e8fe9f71 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/lwg4084.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/lwg4084.cc
@@ -20,7 +20,11 @@ test_nan()
   out << ' ' << nan << ' ' << -nan;
   out << std::showpos;
   out << ' ' << nan << ' ' << -nan;
+#ifdef _AIX // non-conforming
+  VERIFY( out.str() == " NaNQ -NaNQ NaNQ -NaNQ NaNQ -NaNQ +NaNQ -NaNQ" );
+#else
   VERIFY( out.str() == " nan -nan NAN -NAN NAN -NAN +NAN -NAN" );
+#endif
 }
 
 void
@@ -36,7 +40,11 @@ test_inf()
   out << ' ' << inf << ' ' << -inf;
   out << std::showpos;
   out << ' ' << inf << ' ' << -inf;
+#ifdef _AIX // non-conforming
+  VERIFY( out.str() == " INF -INF INF -INF INF -INF +INF -INF" );
+#else
   VERIFY( out.str() == " inf -inf INF -INF INF -INF +INF -INF" );
+#endif
 }
 
 int main()

Reply via email to