Skip to content

Commit e0c7345

Browse files
authored
[libc++][test] Replace uses of _LIBCPP_ABI_MICROSOFT in tests (#77233)
1 parent 6d19e89 commit e0c7345

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <memory>
1818
#include <cassert>
1919

20+
#include "test_macros.h"
21+
2022
__attribute__((noinline)) void call_something() { asm volatile(""); }
2123

2224
struct Base {
@@ -55,7 +57,7 @@ int main(int, char**) {
5557
func(A(shared_buf, &cur_idx), std::unique_ptr<B>(new B(shared_buf, &cur_idx)),
5658
C(shared_buf, &cur_idx));
5759

58-
#if defined(_LIBCPP_ABI_MICROSOFT)
60+
#if defined(TEST_ABI_MICROSOFT)
5961
// On Microsoft ABI, the dtor order is always A,B,C (because callee-destroyed)
6062
assert(shared_buf[0] == 'A' && shared_buf[1] == 'B' && shared_buf[2] == 'C');
6163
#else

libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main(int, char**)
3939
}
4040
catch (const A& a)
4141
{
42-
#ifndef _LIBCPP_ABI_MICROSOFT
42+
#ifndef TEST_ABI_MICROSOFT
4343
assert(A::constructed == 1);
4444
#else
4545
// On Windows exception_ptr copies the exception

libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ int main(int, char**)
4747
}
4848
catch (const A& a)
4949
{
50-
#ifndef _LIBCPP_ABI_MICROSOFT
50+
#ifndef TEST_ABI_MICROSOFT
5151
assert(A::constructed == 1);
5252
#else
5353
// On Windows the exception_ptr copies the exception

libcxx/test/support/msvc_stdlib_force_include.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const AssertionDialogAvoider assertion_dialog_avoider{};
101101
#endif
102102

103103
#define TEST_SHORT_WCHAR
104+
#define TEST_ABI_MICROSOFT
104105

105106
#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
106107

libcxx/test/support/test_macros.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ inline Tp const& DoNotOptimize(Tp const& value) {
451451
# define TEST_SHORT_WCHAR
452452
#endif
453453

454+
#ifdef _LIBCPP_ABI_MICROSOFT
455+
# define TEST_ABI_MICROSOFT
456+
#endif
457+
454458
// This is a temporary workaround for user-defined `operator new` definitions
455459
// not being picked up on Apple platforms in some circumstances. This is under
456460
// investigation and should be short-lived.

0 commit comments

Comments
 (0)