Skip to content

[libcxx][test][AIX] Fix the thousands_sep expectation for fr_FR locales #92312

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

Merged
merged 3 commits into from
May 27, 2024

Conversation

daltenty
Copy link
Member

Similar to some other platforms, AIX uses ' ' for non-wide characters and U202F for wide characters, so this change opts into those paths for AIX as well.

Similar to some other platforms, AIX uses ' ' for non-wide characters
and U202F for wide characters.
@daltenty daltenty requested review from jakeegan and xingxue-ibm May 15, 2024 20:31
@daltenty daltenty requested a review from a team as a code owner May 15, 2024 20:31
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label May 15, 2024
@llvmbot
Copy link
Member

llvmbot commented May 15, 2024

@llvm/pr-subscribers-libcxx

Author: David Tenty (daltenty)

Changes

Similar to some other platforms, AIX uses ' ' for non-wide characters and U202F for wide characters, so this change opts into those paths for AIX as well.


Full diff: https://github.com/llvm/llvm-project/pull/92312.diff

1 Files Affected:

  • (modified) libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp (+3-2)
diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
index d7e1178c92e04..afab7f4e7d19f 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -9,7 +9,6 @@
 // NetBSD does not support LC_NUMERIC at the moment
 // XFAIL: netbsd
 
-// XFAIL: LIBCXX-AIX-FIXME
 // XFAIL: LIBCXX-FREEBSD-FIXME
 
 // REQUIRES: locale.en_US.UTF-8
@@ -64,7 +63,7 @@ int main(int, char**)
         // The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep.
         std::locale l(LOCALE_fr_FR_UTF_8);
         {
-#if defined(_CS_GNU_LIBC_VERSION) || defined(_WIN32)
+#if defined(_CS_GNU_LIBC_VERSION) || defined(_WIN32) || defined(_AIX)
             const char sep = ' ';
 #else
             const char sep = ',';
@@ -77,6 +76,8 @@ int main(int, char**)
         {
 #if defined(_CS_GNU_LIBC_VERSION)
             const wchar_t wsep = glibc_version_less_than("2.27") ? L' ' : L'\u202f';
+#elif defined(_AIX)
+	    const wchar_t wsep = L'\u202f';
 #elif defined(_WIN32)
             const wchar_t wsep = L'\u00A0';
 #else

Copy link

github-actions bot commented May 15, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Contributor

@xingxue-ibm xingxue-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@mordante mordante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo one nit.

@mordante mordante self-assigned this May 16, 2024
Co-authored-by: Mark de Wever <[email protected]>
@daltenty daltenty merged commit f114edd into llvm:main May 27, 2024
54 checks passed
@daltenty daltenty deleted the daltenty/fixme-fr-libcxx branch May 27, 2024 19:39
daltenty added a commit that referenced this pull request Jun 14, 2024
…#94826)

This is a follow on to #92312,
where we address some more locale platform differences. These are:

- for locale fr_FR AIX libc expects `U202F` as `LC_MONETARY`
`thousands_sep`
- for locale zh_CN AIX libc `LC_MONETARY` has `n_sign_posn == 1`,
indicating the `negative_sign` should come before the `currency_symbol`
string
blueboxd pushed a commit to blueboxd/libcxx that referenced this pull request Apr 19, 2025
… (#94826)

This is a follow on to llvm/llvm-project#92312,
where we address some more locale platform differences. These are:

- for locale fr_FR AIX libc expects `U202F` as `LC_MONETARY`
`thousands_sep`
- for locale zh_CN AIX libc `LC_MONETARY` has `n_sign_posn == 1`,
indicating the `negative_sign` should come before the `currency_symbol`
string

NOKEYCHECK=True
GitOrigin-RevId: 9afb09e674d6195faf09431dda8a3a08886ab27d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants