diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp @@ -49,8 +49,7 @@ path p = fs::u8path(In3, In3End); assert(p == In1); } -#if TEST_STD_VER > 17 && defined(__cpp_char8_t) && defined(_LIBCPP_VERSION) && \ - !defined(_LIBCPP_HAS_NO_LOCALIZATION) +#if TEST_STD_VER > 17 && defined(__cpp_char8_t) && defined(_LIBCPP_VERSION) && !defined(TEST_HAS_NO_LOCALIZATION) const char8_t* u8In1 = u8"abcd/efg"; const std::u8string u8In2(u8In1); const auto u8In3 = u8In2.begin(); diff --git a/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp b/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp --- a/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp +++ b/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp @@ -33,10 +33,10 @@ #include #include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -# include -# include +#ifndef TEST_HAS_NO_LOCALIZATION +# include +# include +# include #endif #ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY @@ -199,14 +199,14 @@ static_assert(testIOIterator>, std::output_iterator_tag>()); static_assert(testConstWithoutConcept, int, std::input_iterator_tag>()); -#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +#if !defined(TEST_HAS_NO_LOCALIZATION) static_assert(testWithoutConcept, char, long long, char, char*, std::input_iterator_tag>()); static_assert(testWithoutConcept, int, std::ptrdiff_t, int&&, int*, std::random_access_iterator_tag>()); static_assert(testIOIterator, std::output_iterator_tag>()); static_assert(testIOIterator, std::output_iterator_tag>()); static_assert(testConstWithoutConcept()); static_assert(testConstWithoutConcept()); -#endif // !_LIBCPP_HAS_NO_LOCALIZATION +#endif // !TEST_HAS_NO_LOCALIZATION #ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY static_assert(testWithoutConcept{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::hex, 20'000).ptr; test_termination_condition(STR(".20000La}"), value, std::basic_string{buffer.begin(), end}); @@ -137,7 +137,7 @@ buffer[size] = '0'; } test_termination_condition(STR("025000.20000A}"), value, std::basic_string{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::hex, 20'000).ptr; std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); }); test_termination_condition(STR(".20000LA}"), value, std::basic_string{buffer.begin(), end}); @@ -177,7 +177,7 @@ buffer[size] = '0'; } test_termination_condition(STR("025000.20000e}"), value, std::basic_string{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::scientific, 20'000).ptr; test_termination_condition(STR(".20000Le}"), value, std::basic_string{buffer.begin(), end}); @@ -217,7 +217,7 @@ buffer[size] = '0'; } test_termination_condition(STR("025000.20000E}"), value, std::basic_string{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::scientific, 20'000).ptr; std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); }); test_termination_condition(STR(".20000LE}"), value, std::basic_string{buffer.begin(), end}); @@ -257,7 +257,7 @@ buffer[size] = '0'; } test_termination_condition(STR("025000.20000f}"), value, std::basic_string{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::fixed, 20'000).ptr; test_termination_condition(STR(".20000Lf}"), value, std::basic_string{buffer.begin(), end}); @@ -297,7 +297,7 @@ buffer[size] = '0'; } test_termination_condition(STR("025000.20000F}"), value, std::basic_string{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::fixed, 20'000).ptr; std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); }); test_termination_condition(STR(".20000LF}"), value, std::basic_string{buffer.begin(), end}); @@ -337,7 +337,7 @@ buffer[size] = '0'; } test_termination_condition(STR("025000.20000g}"), value, std::basic_string{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::general, 20'000).ptr; test_termination_condition(STR(".20000Lg}"), value, std::basic_string{buffer.begin(), end}); @@ -377,7 +377,7 @@ buffer[size] = '0'; } test_termination_condition(STR("025000.20000G}"), value, std::basic_string{buffer.begin(), buffer.end()}); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::general, 20'000).ptr; std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); }); test_termination_condition(STR(".20000LG}"), value, std::basic_string{buffer.begin(), end}); diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp @@ -33,7 +33,7 @@ #include #include #include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION # include #endif #include @@ -213,7 +213,7 @@ assert_formatter_is_disabled(); #endif assert_formatter_is_disabled, CharT>(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION assert_formatter_is_disabled, CharT>(); #endif #ifndef _LIBCPP_HAS_NO_THREADS diff --git a/libcxx/test/std/utilities/format/format.functions/format.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/format.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/format.pass.cpp @@ -24,7 +24,7 @@ #include #include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION # include #endif #include @@ -35,7 +35,7 @@ auto test = [](std::basic_string_view expected, std::basic_string_view fmt, const Args&... args) { std::basic_string out = std::format(fmt, args...); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#ifndef TEST_HAS_NO_LOCALIZATION if constexpr (std::same_as) if (out != expected) std::cerr << "\nFormat string " << fmt << "\nExpected output " << expected << "\nActual output " << out @@ -49,13 +49,13 @@ #ifndef TEST_HAS_NO_EXCEPTIONS try { std::format(fmt, args...); -# ifndef _LIBCPP_HAS_NO_LOCALIZATION +# ifndef TEST_HAS_NO_LOCALIZATION if constexpr (std::same_as) std::cerr << "\nFormat string " << fmt << "\nDidn't throw an exception.\n"; # endif assert(false); } catch (const std::format_error& e) { -# if defined(_LIBCPP_VERSION) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# if defined(_LIBCPP_VERSION) && !defined(TEST_HAS_NO_LOCALIZATION) if constexpr (std::same_as) if (e.what() != what) std::cerr << "\nFormat string " << fmt << "\nExpected exception " << what << "\nActual exception " diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -376,6 +376,10 @@ # define TEST_HAS_NO_UNICODE_CHARS #endif +#if define(_LIBCPP_HAS_NO_LOCALIZATION) +# define TEST_HAS_NO_LOCALIZATION +#endif + #if defined(__GNUC__) #pragma GCC diagnostic pop #endif