[libcxx-commits] [PATCH] D119348: [libcxx] [test] Fix the aligned storage test to work on Windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 9 09:04:51 PST 2022


mstorsjo updated this revision to Diff 407179.
mstorsjo added a comment.

Added testing of specifically 8K alignment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119348

Files:
  libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp


Index: libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
===================================================================
--- libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
+++ libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
@@ -6,8 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // type_traits
 
 // aligned_storage
@@ -313,6 +311,16 @@
     static_assert(std::alignment_of<T1>::value == 8, "");
     static_assert(sizeof(T1) == 16, "");
     }
+  {
+    const int Align = 8192;
+    typedef typename std::aligned_storage<1, Align>::type T1;
+    static_assert(std::is_trivial<T1>::value, "");
+    static_assert(std::is_standard_layout<T1>::value, "");
+    static_assert(std::alignment_of<T1>::value == Align, "");
+    static_assert(sizeof(T1) == Align, "");
+  }
+#ifndef _WIN32
+  // Windows only supports alignment up to 8192 bytes.
   {
     const int Align = 65536;
     typedef typename std::aligned_storage<1, Align>::type T1;
@@ -321,6 +329,7 @@
     static_assert(std::alignment_of<T1>::value == Align, "");
     static_assert(sizeof(T1) == Align, "");
   }
+#endif
 
   return 0;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119348.407179.patch
Type: text/x-patch
Size: 1291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220209/d8f3f2b7/attachment.bin>


More information about the libcxx-commits mailing list