[libcxx-commits] [PATCH] D106092: [libcxx] Updated test and seemingly incorrect comment from it.
Vy Nguyen via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 15 12:52:49 PDT 2021
oontvoo created this revision.
oontvoo added reviewers: mstorsjo, ldionne.
oontvoo requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Background: https://reviews.llvm.org/D82490#inline-1007741
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106092
Files:
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
Index: libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
===================================================================
--- libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
+++ libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
@@ -9,15 +9,12 @@
// <memory>
// Test arguments destruction order involving unique_ptr<T> 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 <memory>
#include <cassert>
@@ -58,7 +55,12 @@
func(A(shared_buf, &cur_idx), std::unique_ptr<B>(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[1] == 'B' && shared_buf[1] == 'C');
+#else
// With trivial_abi, the std::unique_ptr<B> arg is always destructed first.
assert(shared_buf[0] == 'B');
+#endif
return 0;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106092.359096.patch
Type: text/x-patch
Size: 1366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210715/4a43f961/attachment-0001.bin>
More information about the libcxx-commits
mailing list