aboutsummaryrefslogtreecommitdiff
path: root/libc/test
diff options
context:
space:
mode:
authorPiJoules <6019989+PiJoules@users.noreply.github.com>2024-06-05 12:59:39 -0700
committerGitHub <noreply@github.com>2024-06-05 12:59:39 -0700
commitb477d1de6e3a5e5860fe7fdf272e8bbb6a330f48 (patch)
treeae99c4652c0fb86e87524e1442c249f64c52f5b4 /libc/test
parenta4b32c25761e3de55d42a4799a303f36aa198fb7 (diff)
downloadllvm-b477d1de6e3a5e5860fe7fdf272e8bbb6a330f48.zip
llvm-b477d1de6e3a5e5860fe7fdf272e8bbb6a330f48.tar.gz
llvm-b477d1de6e3a5e5860fe7fdf272e8bbb6a330f48.tar.bz2
[libc][type_traits] Add aligned_storage (#94074)
Diffstat (limited to 'libc/test')
-rw-r--r--libc/test/src/__support/CPP/type_traits_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libc/test/src/__support/CPP/type_traits_test.cpp b/libc/test/src/__support/CPP/type_traits_test.cpp
index a2051f3..1c428e9 100644
--- a/libc/test/src/__support/CPP/type_traits_test.cpp
+++ b/libc/test/src/__support/CPP/type_traits_test.cpp
@@ -112,6 +112,15 @@ TEST(LlvmLibcTypeTraitsTest, add_rvalue_reference_void) {
const volatile void>));
}
+TEST(LlvmLibcTypeTraitsTest, aligned_storage) {
+ struct S {
+ int a, b;
+ };
+ aligned_storage_t<sizeof(S), alignof(S)> buf;
+ EXPECT_EQ(alignof(buf), alignof(S));
+ EXPECT_EQ(sizeof(buf), sizeof(S));
+}
+
TEST(LlvmLibcTypeTraitsTest, bool_constant) {
EXPECT_TRUE((bool_constant<true>::value));
EXPECT_FALSE((bool_constant<false>::value));