diff options
author | PiJoules <6019989+PiJoules@users.noreply.github.com> | 2024-06-05 12:59:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 12:59:39 -0700 |
commit | b477d1de6e3a5e5860fe7fdf272e8bbb6a330f48 (patch) | |
tree | ae99c4652c0fb86e87524e1442c249f64c52f5b4 /libc/test | |
parent | a4b32c25761e3de55d42a4799a303f36aa198fb7 (diff) | |
download | llvm-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.cpp | 9 |
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)); |