[libcxx-commits] [libcxx] [libc++][test] Replace uses of `_LIBCPP_ABI_MICROSOFT` in tests (PR #77233)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jan 7 02:46:17 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: S. B. Tam (cpplearner)
<details>
<summary>Changes</summary>
No 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:
- (modified) libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp (+1-1)
- (modified) libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp (+1-1)
- (modified) libcxx/test/support/msvc_stdlib_force_include.h (+1)
- (modified) libcxx/test/support/test_macros.h (+4)
``````````diff
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.
``````````
</details>
https://github.com/llvm/llvm-project/pull/77233
More information about the libcxx-commits
mailing list