[libcxx-commits] [libcxx] 2c425c1 - [libcxx] [test] Clarify weak_ptr_ret on Windows, remove a LIBCXX-WINDOWS-FIXME

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 13 23:08:55 PDT 2021


Author: Martin Storsjö
Date: 2021-07-14T09:08:06+03:00
New Revision: 2c425c17e678c522d8f4961e9ad94ad718a7cba0

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

LOG: [libcxx] [test] Clarify weak_ptr_ret on Windows, remove a LIBCXX-WINDOWS-FIXME

On Windows, structs with a destructor are always returned indirectly;
add this to the list of known exceptions in the test where the class
isn't returned in registers as expected.

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp b/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
index 2da9dd3aea7c4..f556eaf0a0c99 100644
--- a/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
+++ b/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
@@ -15,8 +15,6 @@
 // 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>
 
@@ -51,9 +49,10 @@ int main(int, char**) {
   //
   // With trivial_abi, local_addr is the address of a local variable in
   // make_val, and hence 
diff erent from &ret.
-#if !defined(__i386__) && !defined(__arm__)
+#if !defined(__i386__) && !defined(__arm__) && !defined(_WIN32)
   // On X86, structs are never returned in registers.
   // On ARM32, structs larger than 4 bytes cannot be returned in registers.
+  // On Windows, structs with a destructor are always returned indirectly.
   // Thus, weak_ptr will be passed indirectly even if it is trivial.
   assert((void*)&ret != local_addr);
 #endif


        


More information about the libcxx-commits mailing list