summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/PointerIntPairTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ADT/PointerIntPairTest.cpp')
-rw-r--r--llvm/unittests/ADT/PointerIntPairTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/PointerIntPairTest.cpp b/llvm/unittests/ADT/PointerIntPairTest.cpp
index 95e280330a7..6b3a4c055c9 100644
--- a/llvm/unittests/ADT/PointerIntPairTest.cpp
+++ b/llvm/unittests/ADT/PointerIntPairTest.cpp
@@ -61,6 +61,9 @@ TEST(PointerIntPairTest, GetSet) {
Pair2.setPointerAndInt(&s, E::Case3);
EXPECT_EQ(&s, Pair2.getPointer());
EXPECT_EQ(E::Case3, Pair2.getInt());
+
+ static_assert(is_trivially_copyable<PointerIntPair<S *, 2, E>>::value,
+ "trivially copyable");
}
TEST(PointerIntPairTest, DefaultInitialize) {
@@ -96,6 +99,11 @@ TEST(PointerIntPairTest, ManyUnusedBits) {
EXPECT_EQ(FixnumPointerTraits::NumLowBitsAvailable - 1,
PointerLikeTypeTraits<decltype(pair)>::NumLowBitsAvailable);
+
+ static_assert(
+ is_trivially_copyable<
+ PointerIntPair<Fixnum31, 1, bool, FixnumPointerTraits>>::value,
+ "trivially copyable");
}
} // end anonymous namespace
OpenPOWER on IntegriCloud