[libcxx-commits] [PATCH] D120979: [libcxx] [test] Skip the get/put long_double_ru_RU tests on Glibc < 2.27

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 5 14:40:09 PST 2022


mstorsjo updated this revision to Diff 413257.
mstorsjo added a comment.
Herald added a subscriber: arichardson.

Add a "bug" feature to check for, for the older glibc versions. We don't have the glibc versions as features to check for directly as `XFAIL: glibc-2.26` etc (which would require massive expressions for all possibly relevant older versions - the issue manifested on RHEL with glibc 2.17), but we can easily check for the specific behaviour we expect.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120979/new/

https://reviews.llvm.org/D120979

Files:
  libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
  libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
  libcxx/utils/libcxx/test/features.py


Index: libcxx/utils/libcxx/test/features.py
===================================================================
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -105,6 +105,18 @@
             }
           """)),
 
+  # Check for Glibc < 2.27, where the ru_RU.UTF-8 locale had
+  # mon_decimal_point == ".", which our tests don't handle.
+  Feature(name='glibc-old-ru_RU-decimal-point',
+          when=lambda cfg: not programSucceeds(cfg, """
+            #include <locale.h>
+            #include <string.h>
+            int main(int, char**) {
+              setlocale(LC_ALL, "ru_RU.UTF-8");
+              return strcmp(localeconv()->mon_decimal_point, ",");
+            }
+          """)),
+
   # Whether Bash can run on the executor.
   # This is not always the case, for example when running on embedded systems.
   #
Index: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
===================================================================
--- libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
+++ libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
@@ -11,6 +11,8 @@
 
 // REQUIRES: locale.ru_RU.UTF-8
 
+// XFAIL: glibc-old-ru_RU-decimal-point
+
 // <locale>
 
 // class money_put<charT, OutputIterator>
Index: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
===================================================================
--- libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
+++ libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
@@ -11,6 +11,8 @@
 
 // REQUIRES: locale.ru_RU.UTF-8
 
+// XFAIL: glibc-old-ru_RU-decimal-point
+
 // <locale>
 
 // class money_get<charT, InputIterator>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120979.413257.patch
Type: text/x-patch
Size: 2167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220305/11db8959/attachment.bin>


More information about the libcxx-commits mailing list