[libcxx-commits] [libcxx] 4baf369 - [libcxx] [test] Fix the new_faligned_allocation.pass.cpp test for MSVC

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 10 01:07:00 PDT 2021


Author: Martin Storsjö
Date: 2021-08-10T11:06:02+03:00
New Revision: 4baf369cde744d0a1b2e146df488cd0d1ba6ef7c

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

LOG: [libcxx] [test] Fix the new_faligned_allocation.pass.cpp test for MSVC

Such environments do have aligned allocation functions these days, but
the RTTI type name test needs to be adjusted for the MSVC C++ ABI.

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

Added: 
    

Modified: 
    libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp b/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
index 28c230e02771a..0e4441e013c67 100644
--- a/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
+++ b/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
@@ -9,10 +9,6 @@
 // test libc++'s implementation of align_val_t, and the relevant new/delete
 // overloads in all dialects when -faligned-allocation is present.
 
-// Libc++ defers to the underlying MSVC library to provide the new/delete
-// definitions, which does not yet provide aligned allocation
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // The dylibs shipped before macosx10.13 do not contain the aligned allocation
 // functions, so trying to force using those with -faligned-allocation results
 // in a link error.
@@ -81,7 +77,13 @@ int main(int, char**) {
   {
     // Check that libc++ doesn't define align_val_t in a versioning namespace.
     // And that it mangles the same in C++03 through C++17
+#ifdef _MSC_VER
+    // MSVC uses a 
diff erent C++ ABI with a 
diff erent name mangling scheme.
+    // The type id name doesn't seem to contain the mangled form at all.
+    assert(typeid(std::align_val_t).name() == std::string("enum std::align_val_t"));
+#else
     assert(typeid(std::align_val_t).name() == std::string("St11align_val_t"));
+#endif
   }
 #endif
 


        


More information about the libcxx-commits mailing list