[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
Fri Jul 16 08:00:02 PDT 2021
oontvoo updated this revision to Diff 359324.
oontvoo marked an inline comment as done.
oontvoo added a comment.
fixed typos
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106092/new/
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_buf[1] == 'B' && shared_buf[2] == '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.359324.patch
Type: text/x-patch
Size: 1370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210716/afea7e15/attachment-0001.bin>
More information about the libcxx-commits
mailing list