summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/MathExtrasTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/MathExtrasTest.cpp')
-rw-r--r--llvm/unittests/Support/MathExtrasTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/Support/MathExtrasTest.cpp b/llvm/unittests/Support/MathExtrasTest.cpp
index d373030881e..c8c49506ce5 100644
--- a/llvm/unittests/Support/MathExtrasTest.cpp
+++ b/llvm/unittests/Support/MathExtrasTest.cpp
@@ -165,6 +165,12 @@ TEST(MathExtras, isPowerOf2_64) {
EXPECT_FALSE(isPowerOf2_64(0xABCDEF0ABCDEF0LL));
}
+TEST(MathExtras, PowerOf2Ceil) {
+ EXPECT_EQ(0, PowerOf2Ceil(0));
+ EXPECT_EQ(8, PowerOf2Ceil(8));
+ EXPECT_EQ(8, PowerOf2Ceil(7));
+}
+
TEST(MathExtras, ByteSwap_32) {
EXPECT_EQ(0x44332211u, ByteSwap_32(0x11223344));
EXPECT_EQ(0xDDCCBBAAu, ByteSwap_32(0xAABBCCDD));
OpenPOWER on IntegriCloud