[libcxx-commits] [libcxx] [libc++][test] Replace uses of `_LIBCPP_ABI_MICROSOFT` in tests (PR #77233)
S. B. Tam via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jan 7 02:45:50 PST 2024
https://github.com/cpplearner created https://github.com/llvm/llvm-project/pull/77233
No functional change for libc++. But this allows MSVC STL to pass the tests.
>From 9dfe8387ef70005c39cf5dcd47106afe29978ba0 Mon Sep 17 00:00:00 2001
From: cpplearner <cpplearner at outlook.com>
Date: Sun, 7 Jan 2024 18:36:21 +0800
Subject: [PATCH] [libc++][test] Replace uses of `_LIBCPP_ABI_MICROSOFT` in
tests
---
.../support.exception/propagation/make_exception_ptr.pass.cpp | 2 +-
.../support.exception/propagation/rethrow_exception.pass.cpp | 2 +-
libcxx/test/support/msvc_stdlib_force_include.h | 1 +
libcxx/test/support/test_macros.h | 4 ++++
4 files changed, 7 insertions(+), 2 deletions(-)
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.
More information about the libcxx-commits
mailing list