diff --git a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp --- a/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp +++ b/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp @@ -9,15 +9,12 @@ // // Test arguments destruction order involving unique_ptr with trivial_abi. -// Note: Unlike other tests in this directory, this is the only test that -// exhibits a difference between the two modes in Microsft ABI. // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI // There were assertion failures in both parse and codegen, which are fixed in clang 11. // UNSUPPORTED: gcc, clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10 -// XFAIL: LIBCXX-WINDOWS-FIXME #include #include @@ -58,7 +55,12 @@ func(A(shared_buf, &cur_idx), std::unique_ptr(new B(shared_buf, &cur_idx)), C(shared_buf, &cur_idx)); +#if defined(_LIBCPP_ABI_MICROSOFT) + // On Microsoft ABI, the dtor order is always A,B,C (because callee-destroyed) + assert(shared_buf[0] == 'A' && shared_buf[1] == 'B' && shared_buf[2] == 'C'); +#else // With trivial_abi, the std::unique_ptr arg is always destructed first. assert(shared_buf[0] == 'B'); +#endif return 0; }