[llvm-commits] [llvm] r82148 - /llvm/trunk/unittests/ADT/APIntTest.cpp
Daniel Dunbar
daniel at zuster.org
Thu Sep 17 10:46:53 PDT 2009
Author: ddunbar
Date: Thu Sep 17 12:46:53 2009
New Revision: 82148
URL: http://llvm.org/viewvc/llvm-project?rev=82148&view=rev
Log:
Another try at fixing compile warnings on 4.0
Modified:
llvm/trunk/unittests/ADT/APIntTest.cpp
Modified: llvm/trunk/unittests/ADT/APIntTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APIntTest.cpp?rev=82148&r1=82147&r2=82148&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/APIntTest.cpp (original)
+++ llvm/trunk/unittests/ADT/APIntTest.cpp Thu Sep 17 12:46:53 2009
@@ -196,12 +196,12 @@
EXPECT_EQ(APInt(32, +15), APInt(32, "+17", 8));
EXPECT_EQ(APInt(32, +16), APInt(32, "+20", 8));
- EXPECT_EQ(APInt(32, -0LL), APInt(32, "-0", 8));
- EXPECT_EQ(APInt(32, -1LL), APInt(32, "-1", 8));
- EXPECT_EQ(APInt(32, -7LL), APInt(32, "-7", 8));
- EXPECT_EQ(APInt(32, -8LL), APInt(32, "-10", 8));
- EXPECT_EQ(APInt(32, -15LL), APInt(32, "-17", 8));
- EXPECT_EQ(APInt(32, -16LL), APInt(32, "-20", 8));
+ EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 8));
+ EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 8));
+ EXPECT_EQ(APInt(32, uint64_t(-7LL)), APInt(32, "-7", 8));
+ EXPECT_EQ(APInt(32, uint64_t(-8LL)), APInt(32, "-10", 8));
+ EXPECT_EQ(APInt(32, uint64_t(-15LL)), APInt(32, "-17", 8));
+ EXPECT_EQ(APInt(32, uint64_t(-16LL)), APInt(32, "-20", 8));
EXPECT_EQ(APInt(32, 0), APInt(32, "0", 10));
@@ -211,12 +211,12 @@
EXPECT_EQ(APInt(32, 19), APInt(32, "19", 10));
EXPECT_EQ(APInt(32, 20), APInt(32, "20", 10));
- EXPECT_EQ(APInt(32, -0LL), APInt(32, "-0", 10));
- EXPECT_EQ(APInt(32, -1LL), APInt(32, "-1", 10));
- EXPECT_EQ(APInt(32, -9LL), APInt(32, "-9", 10));
- EXPECT_EQ(APInt(32, -10LL), APInt(32, "-10", 10));
- EXPECT_EQ(APInt(32, -19LL), APInt(32, "-19", 10));
- EXPECT_EQ(APInt(32, -20LL), APInt(32, "-20", 10));
+ EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 10));
+ EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 10));
+ EXPECT_EQ(APInt(32, uint64_t(-9LL)), APInt(32, "-9", 10));
+ EXPECT_EQ(APInt(32, uint64_t(-10LL)), APInt(32, "-10", 10));
+ EXPECT_EQ(APInt(32, uint64_t(-19LL)), APInt(32, "-19", 10));
+ EXPECT_EQ(APInt(32, uint64_t(-20LL)), APInt(32, "-20", 10));
EXPECT_EQ(APInt(32, 0), APInt(32, "0", 16));
@@ -226,12 +226,12 @@
EXPECT_EQ(APInt(32, 31), APInt(32, "1F", 16));
EXPECT_EQ(APInt(32, 32), APInt(32, "20", 16));
- EXPECT_EQ(APInt(32, -0LL), APInt(32, "-0", 16));
- EXPECT_EQ(APInt(32, -1LL), APInt(32, "-1", 16));
- EXPECT_EQ(APInt(32, -15LL), APInt(32, "-F", 16));
- EXPECT_EQ(APInt(32, -16LL), APInt(32, "-10", 16));
- EXPECT_EQ(APInt(32, -31LL), APInt(32, "-1F", 16));
- EXPECT_EQ(APInt(32, -32LL), APInt(32, "-20", 16));
+ EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 16));
+ EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 16));
+ EXPECT_EQ(APInt(32, uint64_t(-15LL)), APInt(32, "-F", 16));
+ EXPECT_EQ(APInt(32, uint64_t(-16LL)), APInt(32, "-10", 16));
+ EXPECT_EQ(APInt(32, uint64_t(-31LL)), APInt(32, "-1F", 16));
+ EXPECT_EQ(APInt(32, uint64_t(-32LL)), APInt(32, "-20", 16));
}
TEST(APIntTest, StringBitsNeeded2) {
More information about the llvm-commits
mailing list