[libcxx-commits] [libcxx] [libcxx] [test] Fix the locale ctype widen tests on AIX (PR #91744)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 10 06:51:45 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Xing Xue (xingxue-ibm)
<details>
<summary>Changes</summary>
The C locale on AIX uses `ISO-8859-1`, where `0xFB` is a valid character. Widening char(-5) succeeds and produces L'\u00fb' the same as on macOS, FreeBSD, and Windows. This patch removes `XFAIL: LIBCXX-AIX-FIXME` and uses the macOS, FreeBSD, and WIN32 code path for AIX.
---
Full diff: https://github.com/llvm/llvm-project/pull/91744.diff
2 Files Affected:
- (modified) libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp (+1-2)
- (modified) libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp (+1-2)
``````````diff
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));
``````````
</details>
https://github.com/llvm/llvm-project/pull/91744
More information about the libcxx-commits
mailing list