[libcxx-commits] [PATCH] D107757: [libcxx] [test] Fix the new_faligned_allocation.pass.cpp test for MSVC

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 9 04:29:28 PDT 2021


mstorsjo created this revision.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107757

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


Index: libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
===================================================================
--- libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
+++ 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 @@
   {
     // 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 different C++ ABI with a different 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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107757.365152.patch
Type: text/x-patch
Size: 1383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210809/1a497afd/attachment.bin>


More information about the libcxx-commits mailing list