Skip to content

Commit a98295d

Browse files
authored
[libc++] Fix localization failures on macOS 15.4 (#138744)
This patch reverts e15025d and 88e15b7 which were temporary measures until we had figured out the underlying issues. It turns out that recent OSes updated localization data, removing the need for several Apple-specific workarounds in the tests. Fixes #135385
1 parent b1d5a2a commit a98295d

File tree

27 files changed

+68
-318
lines changed

27 files changed

+68
-318
lines changed

libcxx/test/libcxx/input.output/iostreams.base/ios.base/ios.base.cons/dtor.uninitialized.pass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
129
// UNSUPPORTED: no-exceptions
1310

1411
// The fix for issue 57964 requires an updated dylib due to explicit
1512
// instantiations. That means Apple backdeployment targets remain broken.
16-
// XFAIL: using-built-library-before-llvm-19
13+
// TODO: Remove && !darwin once availability markup for LLVM 19 on macOS has been added
14+
// XFAIL: using-built-library-before-llvm-19 && !darwin
1715

1816
// <ios>
1917

libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/setbuf.pass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
129
// <fstream>
1310

1411
// basic_streambuf<charT, traits>* setbuf(char_type* s, streamsize n) override;
1512

1613
// This test requires the fix to https://llvm.org/PR60509 in the dylib,
1714
// which landed in 5afb937d8a30445642ccaf33866ee4cdd0713222.
18-
// XFAIL: using-built-library-before-llvm-19
15+
// TODO: Remove && !darwin once availability markup for LLVM 19 on macOS has been added
16+
// XFAIL: using-built-library-before-llvm-19 && !darwin
1917

2018
#include <fstream>
2119
#include <cstddef>

libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
129
// <istream>
1310

1411
// int sync();
1512

1613
// The fix for bug 51497 and bug 51499 require and updated dylib due to
1714
// explicit instantiations. That means Apple backdeployment targets remain
1815
// broken.
19-
// XFAIL: using-built-library-before-llvm-19
16+
// TODO: Remove && !darwin once availability markup for LLVM 19 on macOS has been added
17+
// XFAIL: using-built-library-before-llvm-19 && !darwin
2018

2119
#include <istream>
2220
#include <cassert>

libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
129
// Bionic has minimal locale support, investigate this later.
1310
// XFAIL: LIBCXX-ANDROID-FIXME
1411

@@ -56,14 +53,7 @@ int main(int, char**)
5653
ASSERT_COMPARE(std::string, "AAA", "BBB", -1);
5754
ASSERT_COMPARE(std::string, "bbb", "aaa", 1);
5855
ASSERT_COMPARE(std::string, "ccc", "ccc", 0);
59-
60-
#if defined(__APPLE__)
61-
// Apple's default collation is case-sensitive
62-
ASSERT_COMPARE(std::string, "aaaaaaA", "BaaaaaA", 1);
63-
#else
64-
// Glibc, Windows, and FreeBSD's default collation is case-insensitive
6556
ASSERT_COMPARE(std::string, "aaaaaaA", "BaaaaaA", -1);
66-
#endif
6757
}
6858
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
6959
{
@@ -73,13 +63,7 @@ int main(int, char**)
7363
ASSERT_COMPARE(std::wstring, L"AAA", L"BBB", -1);
7464
ASSERT_COMPARE(std::wstring, L"bbb", L"aaa", 1);
7565
ASSERT_COMPARE(std::wstring, L"ccc", L"ccc", 0);
76-
#if defined(__APPLE__)
77-
// Apple's default collation is case-sensitive
78-
ASSERT_COMPARE(std::wstring, L"aaaaaaA", L"BaaaaaA", 1);
79-
#else
80-
// Glibc, Windows, and FreeBSD's default collation is case-insensitive
8166
ASSERT_COMPARE(std::wstring, L"aaaaaaA", L"BaaaaaA", -1);
82-
#endif
8367
}
8468
#endif
8569
}

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
12-
// XFAIL: darwin
13-
149
// NetBSD does not support LC_MONETARY at the moment
1510
// XFAIL: netbsd
1611

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
129
// NetBSD does not support LC_MONETARY at the moment
1310
// XFAIL: netbsd
1411

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
129
// NetBSD does not support LC_MONETARY at the moment
1310
// XFAIL: netbsd
1411

@@ -158,7 +155,7 @@ int main(int, char**)
158155
std::noshowbase(ios);
159156
}
160157
{ // negative one, showbase
161-
#ifdef _AIX
158+
#if defined(_AIX) || defined(__APPLE__)
162159
std::string v = "-" + currency_symbol + "0.01";
163160
#else
164161
std::string v = currency_symbol + "-0.01";
@@ -172,7 +169,7 @@ int main(int, char**)
172169
assert(ex == -1);
173170
}
174171
{ // negative one, showbase
175-
#ifdef _AIX
172+
#if defined(_AIX) || defined(__APPLE__)
176173
std::string v = "-" + currency_symbol + "0.01";
177174
#else
178175
std::string v = currency_symbol + "-0.01";
@@ -212,7 +209,7 @@ int main(int, char**)
212209
std::noshowbase(ios);
213210
}
214211
{ // negative, showbase
215-
#ifdef _AIX
212+
#if defined(_AIX) || defined(__APPLE__)
216213
std::string v = "-" + currency_symbol + "1,234,567.89";
217214
#else
218215
std::string v = currency_symbol + "-1,234,567.89";
@@ -333,7 +330,7 @@ int main(int, char**)
333330
std::noshowbase(ios);
334331
}
335332
{ // negative one, showbase
336-
#if defined(TEST_HAS_GLIBC) || defined(_AIX)
333+
#if defined(TEST_HAS_GLIBC) || defined(_AIX) || defined(__APPLE__)
337334
std::string v = "-" + currency_name + "0.01";
338335
#else
339336
std::string v = currency_name + "-0.01";
@@ -348,7 +345,7 @@ int main(int, char**)
348345
assert(ex == -1);
349346
}
350347
{ // negative one, showbase
351-
#if defined(TEST_HAS_GLIBC) || defined(_AIX)
348+
#if defined(TEST_HAS_GLIBC) || defined(_AIX) || defined(__APPLE__)
352349
std::string v = "-" + currency_name + "0.01";
353350
#else
354351
std::string v = currency_name + "-0.01";
@@ -389,7 +386,7 @@ int main(int, char**)
389386
std::noshowbase(ios);
390387
}
391388
{ // negative, showbase
392-
#if defined(TEST_HAS_GLIBC) || defined(_AIX)
389+
#if defined(TEST_HAS_GLIBC) || defined(_AIX) || defined(__APPLE__)
393390
std::string v = "-" + currency_name + "1,234,567.89";
394391
#else
395392
std::string v = currency_name + "-1,234,567.89";
@@ -518,7 +515,7 @@ int main(int, char**)
518515
std::noshowbase(ios);
519516
}
520517
{ // negative one, showbase
521-
# ifdef _AIX
518+
# if defined(_AIX) || defined(__APPLE__)
522519
std::wstring v = L"-" + w_currency_symbol + L"0.01";
523520
# else
524521
std::wstring v = w_currency_symbol + L"-0.01";
@@ -532,7 +529,7 @@ int main(int, char**)
532529
assert(ex == -1);
533530
}
534531
{ // negative one, showbase
535-
# ifdef _AIX
532+
# if defined(_AIX) || defined(__APPLE__)
536533
std::wstring v = L"-" + w_currency_symbol + L"0.01";
537534
# else
538535
std::wstring v = w_currency_symbol + L"-0.01";
@@ -572,7 +569,7 @@ int main(int, char**)
572569
std::noshowbase(ios);
573570
}
574571
{ // negative, showbase
575-
# ifdef _AIX
572+
# if defined(_AIX) || defined(__APPLE__)
576573
std::wstring v = L"-" + w_currency_symbol + L"1,234,567.89";
577574
# else
578575
std::wstring v = w_currency_symbol + L"-1,234,567.89";
@@ -693,7 +690,7 @@ int main(int, char**)
693690
std::noshowbase(ios);
694691
}
695692
{ // negative one, showbase
696-
# if defined(TEST_HAS_GLIBC) || defined(_AIX)
693+
# if defined(TEST_HAS_GLIBC) || defined(_AIX) || defined(__APPLE__)
697694
std::wstring v = L"-" + w_currency_name + L"0.01";
698695
# else
699696
std::wstring v = w_currency_name + L"-0.01";
@@ -707,7 +704,7 @@ int main(int, char**)
707704
assert(ex == -1);
708705
}
709706
{ // negative one, showbase
710-
# if defined(TEST_HAS_GLIBC) || defined(_AIX)
707+
# if defined(TEST_HAS_GLIBC) || defined(_AIX) || defined(__APPLE__)
711708
std::wstring v = L"-" + w_currency_name + L"0.01";
712709
# else
713710
std::wstring v = w_currency_name + L"-0.01";
@@ -747,7 +744,7 @@ int main(int, char**)
747744
std::noshowbase(ios);
748745
}
749746
{ // negative, showbase
750-
# if defined(TEST_HAS_GLIBC) || defined(_AIX)
747+
# if defined(TEST_HAS_GLIBC) || defined(_AIX) || defined(__APPLE__)
751748
std::wstring v = L"-" + w_currency_name + L"1,234,567.89";
752749
# else
753750
std::wstring v = w_currency_name + L"-1,234,567.89";

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
12-
// XFAIL: darwin
13-
149
// NetBSD does not support LC_MONETARY at the moment
1510
// XFAIL: netbsd
1611

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO(mordante) Investigate
10-
// UNSUPPORTED: apple-clang
11-
129
// NetBSD does not support LC_MONETARY at the moment
1310
// XFAIL: netbsd
1411

0 commit comments

Comments
 (0)