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.
---

Tested x86_64-linux and powerpc-aix.

Pushed to trunk.

 .../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()
-- 
2.49.0

Reply via email to