summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-09-04 00:48:54 +0000
committerEric Fiselier <eric@efcs.ca>2016-09-04 00:48:54 +0000
commitf49fe8f2b68c3a4e6d81dab780ec4c3798392940 (patch)
tree1ffd2fe4539cbb3268f32f0f77d01a296e2dd6ac
parent82216f0faab3a97198aefef61c882af07d4cea39 (diff)
downloadbcm5719-llvm-f49fe8f2b68c3a4e6d81dab780ec4c3798392940.tar.gz
bcm5719-llvm-f49fe8f2b68c3a4e6d81dab780ec4c3798392940.zip
Fix bad locale test data when using the newest glibc
llvm-svn: 280608
-rw-r--r--libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp8
-rw-r--r--libcxx/test/support/test_macros.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
index 6d23d6361f8..7d34bd0e9fd 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
@@ -24,6 +24,7 @@
#include <limits>
#include <cassert>
+#include "test_macros.h"
#include "platform_support.h" // locale name macros
class Fnf
@@ -113,7 +114,14 @@ int main()
{
Fnf f(LOCALE_ru_RU_UTF_8, 1);
+ // GLIBC <= 2.23 uses currency_symbol="<U0440><U0443><U0431>"
+ // GLIBC >= 2.24 uses currency_symbol="<U20BD>"
+ // See also: http://www.fileformat.info/info/unicode/char/20bd/index.htm
+#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+ assert(f.curr_symbol() == " \xE2\x82\xBD");
+#else
assert(f.curr_symbol() == " \xD1\x80\xD1\x83\xD0\xB1");
+#endif
}
{
Fnt f(LOCALE_ru_RU_UTF_8, 1);
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 752bcdaecdd..affd26ba033 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -62,6 +62,13 @@
#endif
#endif
+// Attempt to deduce GCC version
+#if defined(_LIBCPP_VERSION) && __has_include(<features.h>)
+#include <features.h>
+#define TEST_HAS_GLIBC
+#define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor)
+#endif
+
/* Features that were introduced in C++14 */
#if TEST_STD_VER >= 14
#define TEST_HAS_EXTENDED_CONSTEXPR
OpenPOWER on IntegriCloud