[PATCH] D34939: MathExtras UnitTest: Assert that isPowerOf2(0) is false. NFC.

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 3 11:43:17 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL307046: MathExtras UnitTest: Assert that isPowerOf2(0) is false. NFC. (authored by zvi).

Repository:
  rL LLVM

https://reviews.llvm.org/D34939

Files:
  llvm/trunk/unittests/Support/MathExtrasTest.cpp


Index: llvm/trunk/unittests/Support/MathExtrasTest.cpp
===================================================================
--- llvm/trunk/unittests/Support/MathExtrasTest.cpp
+++ llvm/trunk/unittests/Support/MathExtrasTest.cpp
@@ -177,13 +177,15 @@
 }
 
 TEST(MathExtras, isPowerOf2_32) {
+  EXPECT_FALSE(isPowerOf2_32(0));
   EXPECT_TRUE(isPowerOf2_32(1 << 6));
   EXPECT_TRUE(isPowerOf2_32(1 << 12));
   EXPECT_FALSE(isPowerOf2_32((1 << 19) + 3));
   EXPECT_FALSE(isPowerOf2_32(0xABCDEF0));
 }
 
 TEST(MathExtras, isPowerOf2_64) {
+  EXPECT_FALSE(isPowerOf2_64(0));
   EXPECT_TRUE(isPowerOf2_64(1LL << 46));
   EXPECT_TRUE(isPowerOf2_64(1LL << 12));
   EXPECT_FALSE(isPowerOf2_64((1LL << 53) + 3));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34939.105109.patch
Type: text/x-patch
Size: 701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170703/90eb6875/attachment.bin>


More information about the llvm-commits mailing list