-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++][test] Replace uses of _LIBCPP_ABI_MICROSOFT
in tests
#77233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libcxx Author: S. B. Tam (cpplearner) ChangesNo functional change for libc++. But this allows MSVC STL to pass the tests. Full diff: https://github.com/llvm/llvm-project/pull/77233.diff 4 Files Affected:
diff --git a/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp b/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
index e97b15adc50a65..8290b874db6479 100644
--- a/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
+++ b/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
@@ -39,7 +39,7 @@ int main(int, char**)
}
catch (const A& a)
{
-#ifndef _LIBCPP_ABI_MICROSOFT
+#ifndef TEST_ABI_MICROSOFT
assert(A::constructed == 1);
#else
// On Windows exception_ptr copies the exception
diff --git a/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp b/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
index d109f98fbc2131..57e1e8e90caa2c 100644
--- a/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
+++ b/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
@@ -47,7 +47,7 @@ int main(int, char**)
}
catch (const A& a)
{
-#ifndef _LIBCPP_ABI_MICROSOFT
+#ifndef TEST_ABI_MICROSOFT
assert(A::constructed == 1);
#else
// On Windows the exception_ptr copies the exception
diff --git a/libcxx/test/support/msvc_stdlib_force_include.h b/libcxx/test/support/msvc_stdlib_force_include.h
index c027dc5c851e56..6c26085e72c45f 100644
--- a/libcxx/test/support/msvc_stdlib_force_include.h
+++ b/libcxx/test/support/msvc_stdlib_force_include.h
@@ -101,6 +101,7 @@ const AssertionDialogAvoider assertion_dialog_avoider{};
#endif
#define TEST_SHORT_WCHAR
+#define TEST_ABI_MICROSOFT
#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index ea289f0432e686..2203b900f94546 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -443,6 +443,10 @@ inline void DoNotOptimize(Tp const& value) {
# define TEST_SHORT_WCHAR
#endif
+#ifdef _LIBCPP_ABI_MICROSOFT
+# define TEST_ABI_MICROSOFT
+#endif
+
// This is a temporary workaround for user-defined `operator new` definitions
// not being picked up on Apple platforms in some circumstances. This is under
// investigation and should be short-lived.
|
You can test this locally with the following command:git-clang-format --diff 4c8dbb68138959477d9fccbae3669663260dfe31 2f53554c3b0628ad79618ad91ad1d5563bfc9baa -- libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp libcxx/test/support/msvc_stdlib_force_include.h libcxx/test/support/test_macros.h View the diff from clang-format here.diff --git a/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp b/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
index 8290b874db..0c96e8fa4b 100644
--- a/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
+++ b/libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
@@ -40,7 +40,7 @@ int main(int, char**)
catch (const A& a)
{
#ifndef TEST_ABI_MICROSOFT
- assert(A::constructed == 1);
+ assert(A::constructed == 1);
#else
// On Windows exception_ptr copies the exception
assert(A::constructed == 2);
diff --git a/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp b/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
index 57e1e8e90c..af5ac863e3 100644
--- a/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
+++ b/libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
@@ -48,7 +48,7 @@ int main(int, char**)
catch (const A& a)
{
#ifndef TEST_ABI_MICROSOFT
- assert(A::constructed == 1);
+ assert(A::constructed == 1);
#else
// On Windows the exception_ptr copies the exception
assert(A::constructed == 2);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo one nit.
libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
Show resolved
Hide resolved
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
Show resolved
Hide resolved
Feel free to land this patch, the GCC CI issue is unrelated. |
No functional change for libc++. But this allows MSVC STL to pass the tests.