[libcxx-commits] [libcxx] 80baa56 - [libc++][lit][AIX] Port tests for money format to AIX

Xing Xue via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 27 12:58:32 PDT 2022


Author: Xing Xue
Date: 2022-06-27T15:57:54-04:00
New Revision: 80baa56c467a0a53477f56e7a5beeaa6de1c36d9

URL: https://github.com/llvm/llvm-project/commit/80baa56c467a0a53477f56e7a5beeaa6de1c36d9
DIFF: https://github.com/llvm/llvm-project/commit/80baa56c467a0a53477f56e7a5beeaa6de1c36d9.diff

LOG: [libc++][lit][AIX] Port tests for money format to AIX

Summary:
This patch ports libc++ LIT test cases for money formats to AIX. On AIX, the money format of locale zh_CN.UTF-8 is the similar to that of en_US.UTF-8, i.e., sign, symbol, none, value.

Reviewed by: Mordante, DiggerLin, libc++

Differential Revision: https://reviews.llvm.org/D128220

Added: 
    

Modified: 
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
index ca4345bdf4ebd..72a28dcdc3470 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
@@ -8,7 +8,6 @@
 //
 // NetBSD does not support LC_MONETARY at the moment
 // XFAIL: netbsd
-// XFAIL: LIBCXX-AIX-FIXME
 
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
@@ -207,7 +206,11 @@ int main(int, char**)
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
         std::money_base::pattern p = f.neg_format();
+#ifdef _AIX
+        assert_sign_symbol_none_value(p);
+#else
         assert_symbol_sign_none_value(p);
+#endif
     }
     {
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
@@ -222,7 +225,11 @@ int main(int, char**)
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         std::money_base::pattern p = f.neg_format();
+#ifdef _AIX
+        assert_sign_symbol_none_value(p);
+#else
         assert_symbol_sign_none_value(p);
+#endif
     }
     {
         Fwt f(LOCALE_zh_CN_UTF_8, 1);

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
index 38aab61bb15cf..25dc04aa34a89 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
@@ -8,7 +8,6 @@
 //
 // NetBSD does not support LC_MONETARY at the moment
 // XFAIL: netbsd
-// XFAIL: LIBCXX-AIX-FIXME
 
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
@@ -191,7 +190,7 @@ int main(int, char**)
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
         std::money_base::pattern p = f.pos_format();
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(_AIX)
         assert_sign_symbol_none_value(p);
 #else
         assert_symbol_sign_none_value(p);
@@ -210,7 +209,7 @@ int main(int, char**)
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         std::money_base::pattern p = f.pos_format();
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(_AIX)
         assert_sign_symbol_none_value(p);
 #else
         assert_symbol_sign_none_value(p);

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
index 3b7f643b8b27f..7ec217a968f95 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
@@ -8,7 +8,6 @@
 
 // NetBSD does not support LC_MONETARY at the moment
 // XFAIL: netbsd
-// XFAIL: LIBCXX-AIX-FIXME
 
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
@@ -115,6 +114,8 @@ int main(int, char**)
     const wchar_t fr_sep = glibc_version_less_than("2.27") ? L' ' : L'\u202F';
 #elif defined(_WIN32)
     const wchar_t fr_sep = L'\u00A0';
+#elif defined(_AIX)
+    const wchar_t fr_sep = L'\u202F';
 #else
     const wchar_t fr_sep = L' ';
 #endif
@@ -145,7 +146,7 @@ int main(int, char**)
     // FIXME libc++ specifically works around \u00A0 by translating it into
     // a regular space.
     const wchar_t wsep = glibc_version_less_than("2.27") ? L'\u00A0' : L'\u202F';
-#   elif defined(_WIN32)
+#   elif defined(_WIN32) || defined(_AIX)
     const wchar_t wsep = L'\u00A0';
 #   else
     const wchar_t wsep = L' ';


        


More information about the libcxx-commits mailing list