]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix lwg4084.cc test FAIL on AIX
authorJonathan Wakely <jwakely@redhat.com>
Wed, 28 May 2025 21:02:58 +0000 (22:02 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 29 May 2025 13:03:51 +0000 (14:03 +0100)
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.

libstdc++-v3/testsuite/22_locale/num_put/put/char/lwg4084.cc

index b7c7da11f863ed4d9e3c18a19f0d838276881b57..6ce4e8fe9f71c941a4c7eb14c8a525ca84947cf9 100644 (file)
@@ -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()