[libc++][test] Consistently use TEST_SHORT_WCHAR#74958
Merged
StephanTLavavej merged 2 commits intollvm:mainfrom Dec 10, 2023
Merged
[libc++][test] Consistently use TEST_SHORT_WCHAR#74958StephanTLavavej merged 2 commits intollvm:mainfrom
TEST_SHORT_WCHAR#74958StephanTLavavej merged 2 commits intollvm:mainfrom
Conversation
…TEST_SHORT_WCHAR. libcxx/test/support/test_macros.h performs this mapping. This was the only test that was directly using the _LIBCPP macro.
Member
|
@llvm/pr-subscribers-libcxx Author: Stephan T. Lavavej (StephanTLavavej) ChangesFound while running libc++'s test suite with MSVC's STL.
Full diff: https://github.com/llvm/llvm-project/pull/74958.diff 2 Files Affected:
diff --git a/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp b/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
index 5c6f86f742baa..23b26722d7be7 100644
--- a/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
@@ -515,7 +515,7 @@ static void test_ill_formed_utf8() {
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
-# ifdef _LIBCPP_SHORT_WCHAR
+# ifdef TEST_SHORT_WCHAR
static void test_ill_formed_utf16() {
using namespace std::literals;
@@ -543,7 +543,7 @@ static void test_ill_formed_utf16() {
L"\xdbff"
"a");
}
-# else // _LIBCPP_SHORT_WCHAR
+# else // TEST_SHORT_WCHAR
static void test_ill_formed_utf32() {
using namespace std::literals;
@@ -552,7 +552,7 @@ static void test_ill_formed_utf32() {
test_format(LR"("\x{ffffffff}")"sv, L"{:?}", L"\xffffffff"); // largest encoded code point
}
-# endif // _LIBCPP_SHORT_WCHAR
+# endif // TEST_SHORT_WCHAR
#endif // TEST_HAS_NO_WIDE_CHARACTERS
int main(int, char**) {
@@ -563,11 +563,11 @@ int main(int, char**) {
test_ill_formed_utf8();
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
-# ifdef _LIBCPP_SHORT_WCHAR
+# ifdef TEST_SHORT_WCHAR
test_ill_formed_utf16();
-# else // _LIBCPP_SHORT_WCHAR
+# else // TEST_SHORT_WCHAR
test_ill_formed_utf32();
-# endif // _LIBCPP_SHORT_WCHAR
+# endif // TEST_SHORT_WCHAR
#endif // TEST_HAS_NO_WIDE_CHARACTERS
return 0;
diff --git a/libcxx/test/support/msvc_stdlib_force_include.h b/libcxx/test/support/msvc_stdlib_force_include.h
index b5ba33bd281c0..5742bbf4f5572 100644
--- a/libcxx/test/support/msvc_stdlib_force_include.h
+++ b/libcxx/test/support/msvc_stdlib_force_include.h
@@ -100,6 +100,8 @@ const AssertionDialogAvoider assertion_dialog_avoider{};
# define TEST_STD_VER 14
#endif
+#define TEST_SHORT_WCHAR
+
#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
#ifdef __clang__
|
Member
Author
|
Thanks! I'm going to go ahead and merge this - the failing checks are all unrelated sporadic failures/timeouts, or the known failure that I just fixed. One stage3 generic-msan check has been queued for almost 10 hours and I don't think we need it here for this very low-risk change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while running libc++'s test suite with MSVC's STL.
escaped_output.unicode.pass.cpp, replace_LIBCPP_SHORT_WCHARwithTEST_SHORT_WCHAR._LIBCPPmacro.libcxx/test/support/test_macros.hperforms this mapping:llvm-project/libcxx/test/support/test_macros.h
Lines 442 to 444 in c60ac50
msvc_stdlib_force_include.h, defineTEST_SHORT_WCHAR.