[libcxx-commits] [libcxx] 3dce6b3 - [libcxx] [test] Fix the aligned storage test to work on Windows
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 10 01:00:29 PST 2022
Author: Martin Storsjö
Date: 2022-02-10T10:59:52+02:00
New Revision: 3dce6b329ce3efa1d51f1101a08cff31ecdbeb12
URL: https://github.com/llvm/llvm-project/commit/3dce6b329ce3efa1d51f1101a08cff31ecdbeb12
DIFF: https://github.com/llvm/llvm-project/commit/3dce6b329ce3efa1d51f1101a08cff31ecdbeb12.diff
LOG: [libcxx] [test] Fix the aligned storage test to work on Windows
Don't test alignment over 8 KB, which isn't supported on that
platform.
Differential Revision: https://reviews.llvm.org/D119348
Added:
Modified:
libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
index 592a34a513d26..890d0d68eb487 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
+++ b/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 @@ int main(int, char**)
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 @@ int main(int, char**)
static_assert(std::alignment_of<T1>::value == Align, "");
static_assert(sizeof(T1) == Align, "");
}
+#endif
return 0;
}
More information about the libcxx-commits
mailing list