Skip to content

Commit f44fc35

Browse files
committed
[libcxx] Updated test and seemingly incorrect comment from it.
Background: https://reviews.llvm.org/D82490#inline-1007741 Differential Revision: https://reviews.llvm.org/D106092
1 parent 428a7c1 commit f44fc35

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
// <memory>
1010

1111
// Test arguments destruction order involving unique_ptr<T> with trivial_abi.
12-
// Note: Unlike other tests in this directory, this is the only test that
13-
// exhibits a difference between the two modes in Microsft ABI.
1412

1513
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI
1614

1715
// There were assertion failures in both parse and codegen, which are fixed in clang 11.
1816
// UNSUPPORTED: gcc, clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10
1917

20-
// XFAIL: LIBCXX-WINDOWS-FIXME
2118

2219
#include <memory>
2320
#include <cassert>
@@ -58,7 +55,12 @@ int main(int, char**) {
5855
func(A(shared_buf, &cur_idx), std::unique_ptr<B>(new B(shared_buf, &cur_idx)),
5956
C(shared_buf, &cur_idx));
6057

58+
#if defined(_LIBCPP_ABI_MICROSOFT)
59+
// On Microsoft ABI, the dtor order is always A,B,C (because callee-destroyed)
60+
assert(shared_buf[0] == 'A' && shared_buf[1] == 'B' && shared_buf[2] == 'C');
61+
#else
6162
// With trivial_abi, the std::unique_ptr<B> arg is always destructed first.
6263
assert(shared_buf[0] == 'B');
64+
#endif
6365
return 0;
6466
}

0 commit comments

Comments
 (0)