[libcxx-commits] [libcxx] f44fc35 - [libcxx] Updated test and seemingly incorrect comment from it.

Vy Nguyen via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 17 10:47:08 PDT 2021


Author: Vy Nguyen
Date: 2021-07-17T13:46:28-04:00
New Revision: f44fc3514909e4fc8db68019c0479e95dea98111

URL: https://github.com/llvm/llvm-project/commit/f44fc3514909e4fc8db68019c0479e95dea98111
DIFF: https://github.com/llvm/llvm-project/commit/f44fc3514909e4fc8db68019c0479e95dea98111.diff

LOG: [libcxx] Updated test and seemingly incorrect comment from it.

Background: https://reviews.llvm.org/D82490#inline-1007741

Differential Revision: https://reviews.llvm.org/D106092

Added: 
    

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

Removed: 
    


################################################################################
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
index 47bc940b27e24..5a8d0590a5ef7 100644
--- 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 @@
 // <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 
diff erence 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 @@ int main(int, char**) {
   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;
 }


        


More information about the libcxx-commits mailing list