aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-05-27 12:06:01 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2025-05-27 13:35:23 +0100
commit7fa1bd660a8a501671a84ca6421db1fc63ce8654 (patch)
treefe7ced2014cf6124a09028d9d2e82563e7df3449
parent324aad35ef42c9c371cf41c42fe180b8dd698239 (diff)
downloadgcc-7fa1bd660a8a501671a84ca6421db1fc63ce8654.zip
gcc-7fa1bd660a8a501671a84ca6421db1fc63ce8654.tar.gz
gcc-7fa1bd660a8a501671a84ca6421db1fc63ce8654.tar.bz2
libstdc++: Fix test failures for 32-bit AIX
With -maix32 (the default) we only have 16-bit wchar_t so these tests fail. The debug.cc one is because we use -fwide-exec-charset=UTF-32BE which tries to encode each wide character as four bytes in a 2-byte wchar_t. The format.cc one is because the clown face character can't be encoded in a single 16-bit wchar_t. libstdc++-v3/ChangeLog: * testsuite/std/format/debug.cc: Disable for targets with 16-bit wchar_t. * testsuite/std/format/functions/format.cc: Use -DUNICODE for targets with 32-bit wchar_t. (test_unicode) [UNICODE]: Only run checks when UNICODE is defined.
-rw-r--r--libstdc++-v3/testsuite/std/format/debug.cc1
-rw-r--r--libstdc++-v3/testsuite/std/format/functions/format.cc3
2 files changed, 4 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/std/format/debug.cc b/libstdc++-v3/testsuite/std/format/debug.cc
index 6165a29..965b4df 100644
--- a/libstdc++-v3/testsuite/std/format/debug.cc
+++ b/libstdc++-v3/testsuite/std/format/debug.cc
@@ -1,6 +1,7 @@
// { dg-options "-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -DUNICODE_ENC" { target le } }
// { dg-options "-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32BE -DUNICODE_ENC" { target be } }
// { dg-do run { target c++23 } }
+// { dg-require-effective-target 4byte_wchar_t }
// { dg-add-options no_pch }
// { dg-timeout-factor 2 }
diff --git a/libstdc++-v3/testsuite/std/format/functions/format.cc b/libstdc++-v3/testsuite/std/format/functions/format.cc
index 93c33b4..e4adf3a 100644
--- a/libstdc++-v3/testsuite/std/format/functions/format.cc
+++ b/libstdc++-v3/testsuite/std/format/functions/format.cc
@@ -1,6 +1,7 @@
// { dg-options "-fexec-charset=UTF-8" }
// { dg-do run { target c++20 } }
// { dg-add-options no_pch }
+// { dg-additional-options "-DUNICODE" { target 4byte_wchar_t } }
#include <format>
@@ -511,6 +512,7 @@ test_bool()
void
test_unicode()
{
+#ifdef UNICODE
// Similar to sC example in test_std_examples, but not from the standard.
// Verify that the character "🤡" has estimated field width 2,
// rather than estimated field width equal to strlen("🤡"), which would be 4,
@@ -564,6 +566,7 @@ test_unicode()
std::string sA = std::format("{:>5}", input[0]);
VERIFY( sA == input[1] );
}
+#endif
}
int main()