[libcxx-commits] [libcxx] 3438d8a - [libcxx] [test] Fix the locale ctype widen tests on AIX (#91744)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 13 03:29:54 PDT 2024
Author: Xing Xue
Date: 2024-05-13T06:29:50-04:00
New Revision: 3438d8ac1ba58d098ff8d25a814b2c8c22d5844b
URL: https://github.com/llvm/llvm-project/commit/3438d8ac1ba58d098ff8d25a814b2c8c22d5844b
DIFF: https://github.com/llvm/llvm-project/commit/3438d8ac1ba58d098ff8d25a814b2c8c22d5844b.diff
LOG: [libcxx] [test] Fix the locale ctype widen tests on AIX (#91744)
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.
Added:
Modified:
libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
Removed:
################################################################################
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));
More information about the libcxx-commits
mailing list