Skip to content

Commit 80baa56

Browse files
committed
[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
1 parent 0533b6e commit 80baa56

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
//
99
// NetBSD does not support LC_MONETARY at the moment
1010
// XFAIL: netbsd
11-
// XFAIL: LIBCXX-AIX-FIXME
1211

1312
// REQUIRES: locale.en_US.UTF-8
1413
// REQUIRES: locale.fr_FR.UTF-8
@@ -207,7 +206,11 @@ int main(int, char**)
207206
{
208207
Fnf f(LOCALE_zh_CN_UTF_8, 1);
209208
std::money_base::pattern p = f.neg_format();
209+
#ifdef _AIX
210+
assert_sign_symbol_none_value(p);
211+
#else
210212
assert_symbol_sign_none_value(p);
213+
#endif
211214
}
212215
{
213216
Fnt f(LOCALE_zh_CN_UTF_8, 1);
@@ -222,7 +225,11 @@ int main(int, char**)
222225
{
223226
Fwf f(LOCALE_zh_CN_UTF_8, 1);
224227
std::money_base::pattern p = f.neg_format();
228+
#ifdef _AIX
229+
assert_sign_symbol_none_value(p);
230+
#else
225231
assert_symbol_sign_none_value(p);
232+
#endif
226233
}
227234
{
228235
Fwt f(LOCALE_zh_CN_UTF_8, 1);

libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
//
99
// NetBSD does not support LC_MONETARY at the moment
1010
// XFAIL: netbsd
11-
// XFAIL: LIBCXX-AIX-FIXME
1211

1312
// REQUIRES: locale.en_US.UTF-8
1413
// REQUIRES: locale.fr_FR.UTF-8
@@ -191,7 +190,7 @@ int main(int, char**)
191190
{
192191
Fnf f(LOCALE_zh_CN_UTF_8, 1);
193192
std::money_base::pattern p = f.pos_format();
194-
#ifdef __APPLE__
193+
#if defined(__APPLE__) || defined(_AIX)
195194
assert_sign_symbol_none_value(p);
196195
#else
197196
assert_symbol_sign_none_value(p);
@@ -210,7 +209,7 @@ int main(int, char**)
210209
{
211210
Fwf f(LOCALE_zh_CN_UTF_8, 1);
212211
std::money_base::pattern p = f.pos_format();
213-
#ifdef __APPLE__
212+
#if defined(__APPLE__) || defined(_AIX)
214213
assert_sign_symbol_none_value(p);
215214
#else
216215
assert_symbol_sign_none_value(p);

libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
// NetBSD does not support LC_MONETARY at the moment
1010
// XFAIL: netbsd
11-
// XFAIL: LIBCXX-AIX-FIXME
1211

1312
// REQUIRES: locale.en_US.UTF-8
1413
// REQUIRES: locale.fr_FR.UTF-8
@@ -115,6 +114,8 @@ int main(int, char**)
115114
const wchar_t fr_sep = glibc_version_less_than("2.27") ? L' ' : L'\u202F';
116115
#elif defined(_WIN32)
117116
const wchar_t fr_sep = L'\u00A0';
117+
#elif defined(_AIX)
118+
const wchar_t fr_sep = L'\u202F';
118119
#else
119120
const wchar_t fr_sep = L' ';
120121
#endif
@@ -145,7 +146,7 @@ int main(int, char**)
145146
// FIXME libc++ specifically works around \u00A0 by translating it into
146147
// a regular space.
147148
const wchar_t wsep = glibc_version_less_than("2.27") ? L'\u00A0' : L'\u202F';
148-
# elif defined(_WIN32)
149+
# elif defined(_WIN32) || defined(_AIX)
149150
const wchar_t wsep = L'\u00A0';
150151
# else
151152
const wchar_t wsep = L' ';

0 commit comments

Comments
 (0)