[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
Tue Aug 10 01:07:15 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4baf369cde74: [libcxx] [test] Fix the new_faligned_allocation.pass.cpp test for MSVC (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107757/new/

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.365375.patch
Type: text/x-patch
Size: 1383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210810/eab69696/attachment.bin>


More information about the libcxx-commits mailing list