-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libcxx] [test] Fix the locale ctype widen tests on AIX #91744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libcxx Author: Xing Xue (xingxue-ibm) ChangesThe C locale on AIX uses Full diff: https://github.com/llvm/llvm-project/pull/91744.diff 2 Files Affected:
diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
index bafdfcea04600..959a4be9e1de9 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
-// XFAIL: LIBCXX-AIX-FIXME
// XFAIL: no-wide-characters
// <locale>
@@ -57,7 +56,7 @@ int main(int, char**)
assert(f.widen('.') == L'.');
assert(f.widen('a') == L'a');
assert(f.widen('1') == L'1');
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(_AIX)
assert(f.widen(char(-5)) == L'\u00fb');
#else
assert(f.widen(char(-5)) == wchar_t(-1));
diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
index 552eab1f2ab41..078b4a6fefb7e 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
-// XFAIL: LIBCXX-AIX-FIXME
// XFAIL: no-wide-characters
// <locale>
@@ -63,7 +62,7 @@ int main(int, char**)
assert(v[3] == L'.');
assert(v[4] == L'a');
assert(v[5] == L'1');
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(_AIX)
assert(v[6] == L'\xfb');
#else
assert(v[6] == wchar_t(-1));
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM!
The C locale on AIX uses
ISO-8859-1
, where0xFB
is a valid character. Widening char(-5) succeeds and produces L'\u00fb' the same as on macOS, FreeBSD, and Windows. This patch removesXFAIL: LIBCXX-AIX-FIXME
and uses the macOS, FreeBSD, and WIN32 code path for AIX.