]> granicus.if.org Git - llvm/commitdiff
Fix signed/unsigned comparison warnings
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 10 Mar 2017 14:16:55 +0000 (14:16 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 10 Mar 2017 14:16:55 +0000 (14:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297460 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ADT/APIntTest.cpp

index 3e30d921f1ee3e05cec4300118435de7cd2470be..f58d1fee45f71ad3985f6bd8dcfc2d0c0caff700 100644 (file)
@@ -1668,8 +1668,8 @@ TEST(APIntTest, insertBits) {
   // Insert single word src into two words of dst.
   APInt i127(127, UINT64_MAX, true);
   i127.insertBits(iSrc, 48);
-  EXPECT_EQ(i127.extractBits(64, 0).getZExtValue(), 0x3456FFFFFFFFFFFF);
-  EXPECT_EQ(i127.extractBits(63, 64).getZExtValue(), 0x7FFFFFFFFFFF8012);
+  EXPECT_EQ(i127.extractBits(64, 0).getZExtValue(), 0x3456FFFFFFFFFFFFull);
+  EXPECT_EQ(i127.extractBits(63, 64).getZExtValue(), 0x7FFFFFFFFFFF8012ull);
 
   // Insert on word boundaries.
   APInt i128(128, 0);
@@ -1685,19 +1685,19 @@ TEST(APIntTest, insertBits) {
 
   APInt i257(257, 0);
   i257.insertBits(APInt(96, UINT64_MAX, true), 64);
-  EXPECT_EQ(i257.extractBits(64, 0).getZExtValue(), 0x0000000000000000);
-  EXPECT_EQ(i257.extractBits(64, 64).getZExtValue(), 0xFFFFFFFFFFFFFFFF);
-  EXPECT_EQ(i257.extractBits(64, 128).getZExtValue(), 0x00000000FFFFFFFF);
-  EXPECT_EQ(i257.extractBits(65, 192).getZExtValue(), 0x0000000000000000);
+  EXPECT_EQ(i257.extractBits(64, 0).getZExtValue(), 0x0000000000000000ull);
+  EXPECT_EQ(i257.extractBits(64, 64).getZExtValue(), 0xFFFFFFFFFFFFFFFFull);
+  EXPECT_EQ(i257.extractBits(64, 128).getZExtValue(), 0x00000000FFFFFFFFull);
+  EXPECT_EQ(i257.extractBits(65, 192).getZExtValue(), 0x0000000000000000ull);
 
   // General insertion.
   APInt i260(260, UINT64_MAX, true);
   i260.insertBits(APInt(129, 1ull << 48), 15);
-  EXPECT_EQ(i260.extractBits(64, 0).getZExtValue(), 0x8000000000007FFF);
-  EXPECT_EQ(i260.extractBits(64, 64).getZExtValue(), 0x0000000000000000);
-  EXPECT_EQ(i260.extractBits(64, 128).getZExtValue(), 0xFFFFFFFFFFFF0000);
-  EXPECT_EQ(i260.extractBits(64, 192).getZExtValue(), 0xFFFFFFFFFFFFFFFF);
-  EXPECT_EQ(i260.extractBits(4, 256).getZExtValue(), 0x000000000000000F);
+  EXPECT_EQ(i260.extractBits(64, 0).getZExtValue(), 0x8000000000007FFFull);
+  EXPECT_EQ(i260.extractBits(64, 64).getZExtValue(), 0x0000000000000000ull);
+  EXPECT_EQ(i260.extractBits(64, 128).getZExtValue(), 0xFFFFFFFFFFFF0000ull);
+  EXPECT_EQ(i260.extractBits(64, 192).getZExtValue(), 0xFFFFFFFFFFFFFFFFull);
+  EXPECT_EQ(i260.extractBits(4, 256).getZExtValue(), 0x000000000000000Full);
 }
 
 TEST(APIntTest, extractBits) {