[libcxx-commits] [libcxx] [libcxx][test][AIX] Fix the thousands_sep expectation for fr_FR locales (PR #92312)

David Tenty via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 15 13:38:52 PDT 2024


https://github.com/daltenty updated https://github.com/llvm/llvm-project/pull/92312

>From f30a4738ec3143ca265b0b5020af79258a91f7f6 Mon Sep 17 00:00:00 2001
From: David Tenty <daltenty at ibm.com>
Date: Tue, 14 May 2024 11:30:28 -0400
Subject: [PATCH 1/2] [libcxx][test][AIX] Fix the thousands_sep expectation for
 fr_FR locales

Similar to some other platforms, AIX uses ' ' for non-wide characters
and U202F for wide characters.
---
 .../locale.numpunct.byname/thousands_sep.pass.cpp            | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
index d7e1178c92e04..afab7f4e7d19f 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -9,7 +9,6 @@
 // NetBSD does not support LC_NUMERIC at the moment
 // XFAIL: netbsd
 
-// XFAIL: LIBCXX-AIX-FIXME
 // XFAIL: LIBCXX-FREEBSD-FIXME
 
 // REQUIRES: locale.en_US.UTF-8
@@ -64,7 +63,7 @@ int main(int, char**)
         // The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep.
         std::locale l(LOCALE_fr_FR_UTF_8);
         {
-#if defined(_CS_GNU_LIBC_VERSION) || defined(_WIN32)
+#if defined(_CS_GNU_LIBC_VERSION) || defined(_WIN32) || defined(_AIX)
             const char sep = ' ';
 #else
             const char sep = ',';
@@ -77,6 +76,8 @@ int main(int, char**)
         {
 #if defined(_CS_GNU_LIBC_VERSION)
             const wchar_t wsep = glibc_version_less_than("2.27") ? L' ' : L'\u202f';
+#elif defined(_AIX)
+	    const wchar_t wsep = L'\u202f';
 #elif defined(_WIN32)
             const wchar_t wsep = L'\u00A0';
 #else

>From 8517e41c4f75ade3879a581088f69eff3fc98ce3 Mon Sep 17 00:00:00 2001
From: David Tenty <daltenty at ibm.com>
Date: Wed, 15 May 2024 16:38:40 -0400
Subject: [PATCH 2/2] Apply clang-format

---
 .../thousands_sep.pass.cpp                       | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
index afab7f4e7d19f..9e629301e1622 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -64,7 +64,7 @@ int main(int, char**)
         std::locale l(LOCALE_fr_FR_UTF_8);
         {
 #if defined(_CS_GNU_LIBC_VERSION) || defined(_WIN32) || defined(_AIX)
-            const char sep = ' ';
+          const char sep = ' ';
 #else
             const char sep = ',';
 #endif
@@ -76,13 +76,13 @@ int main(int, char**)
         {
 #if defined(_CS_GNU_LIBC_VERSION)
             const wchar_t wsep = glibc_version_less_than("2.27") ? L' ' : L'\u202f';
-#elif defined(_AIX)
-	    const wchar_t wsep = L'\u202f';
-#elif defined(_WIN32)
-            const wchar_t wsep = L'\u00A0';
-#else
-            const wchar_t wsep = L',';
-#endif
+#  elif defined(_AIX)
+          const wchar_t wsep = L'\u202f';
+#  elif defined(_WIN32)
+          const wchar_t wsep = L'\u00A0';
+#  else
+          const wchar_t wsep = L',';
+#  endif
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.thousands_sep() == wsep);



More information about the libcxx-commits mailing list