summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2018-04-04 04:48:26 +0000
committerEric Fiselier <eric@efcs.ca>2018-04-04 04:48:26 +0000
commitc18fe4cf41f852082920e5c99aeeeddcb6551842 (patch)
tree6f751fbf1e64f40415651528aebeb92c7fece671 /libcxx/test/std
parent06091cfa7ad3978dc492630651d8741b7bf415da (diff)
downloadbcm5719-llvm-c18fe4cf41f852082920e5c99aeeeddcb6551842.tar.gz
bcm5719-llvm-c18fe4cf41f852082920e5c99aeeeddcb6551842.zip
Fix undefined macro issue in locale tests; Try 2
llvm-svn: 329149
Diffstat (limited to 'libcxx/test/std')
-rw-r--r--libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp9
-rw-r--r--libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp9
-rw-r--r--libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp6
3 files changed, 15 insertions, 9 deletions
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
index 7d1fee4d3c3..bebc1f27bb3 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -52,9 +52,10 @@ public:
// this function converts the spaces in string inputs to that character if need
// be.
static std::wstring convert_thousands_sep(std::wstring const& in) {
-#if !defined(TEST_HAS_GLIBC) || !TEST_GLIBC_PREREQ(2,27)
- return in;
-#else
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if TEST_GLIBC_PREREQ(2,27)
std::wstring out;
unsigned I = 0;
bool seen_decimal = false;
@@ -68,6 +69,8 @@ static std::wstring convert_thousands_sep(std::wstring const& in) {
out.push_back(L'\u202F');
}
return out;
+#else
+ return in;
#endif
}
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
index acad6e32fd1..2b431dc529d 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
@@ -52,9 +52,10 @@ public:
// this function converts the spaces in string inputs to that character if need
// be.
static std::wstring convert_thousands_sep(std::wstring const& in) {
-#if !defined(TEST_HAS_GLIBC) || !TEST_GLIBC_PREREQ(2,27)
- return in;
-#else
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if TEST_GLIBC_PREREQ(2,27)
std::wstring out;
unsigned I = 0;
bool seen_num_start = false;
@@ -70,6 +71,8 @@ static std::wstring convert_thousands_sep(std::wstring const& in) {
out.push_back(L'\u202F');
}
return out;
+#else
+ return in;
#endif
}
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
index 880d800c572..ca8abf09b83 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
@@ -101,6 +101,9 @@ int main()
assert(f.thousands_sep() == ' ');
}
// The below tests work around GLIBC's use of U202F as mon_thousands_sep.
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
#if defined(TEST_HAS_GLIBC) && TEST_GLIBC_PREREQ(2, 27)
const wchar_t fr_sep = L'\u202F';
#else
@@ -118,9 +121,6 @@ int main()
// and U002E as mon_decimal_point.
// TODO: Fix thousands_sep for 'char'.
// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006
-#ifndef TEST_GLIBC_PREREQ
-#define TEST_GLIBC_PREREQ(x, y) 0
-#endif
#ifndef TEST_HAS_GLIBC
const char sep = ' ';
const wchar_t wsep = L' ';
OpenPOWER on IntegriCloud