diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2009-04-08 16:17:23 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2009-04-08 16:17:23 +0000 |
commit | a69dcf2dcdcfe775c83175e81133d0c8d31e62cc (patch) | |
tree | 188e428958f878079d6ac69277e630ea5325e6c2 /unittests/ADT | |
parent | b26608f35754d99cf1f0198193a4c3edf05c3e3d (diff) | |
download | external_llvm-a69dcf2dcdcfe775c83175e81133d0c8d31e62cc.zip external_llvm-a69dcf2dcdcfe775c83175e81133d0c8d31e62cc.tar.gz external_llvm-a69dcf2dcdcfe775c83175e81133d0c8d31e62cc.tar.bz2 |
* Fixed calls to APInt ctor to work for negative values on Darwin/x86
* Converted C-style casts to C++-style casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r-- | unittests/ADT/APIntTest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp index bb54cd9..dcafae2 100644 --- a/unittests/ADT/APIntTest.cpp +++ b/unittests/ADT/APIntTest.cpp @@ -39,11 +39,11 @@ TEST(APIntTest, ShiftLeftByZero) { } TEST(APIntTest, i128_NegativeCount) { - APInt Minus3(128, (uint64_t)-3, true); + APInt Minus3(128, static_cast<uint64_t>(-3), true); EXPECT_EQ(126u, Minus3.countLeadingOnes()); EXPECT_EQ(-3, Minus3.getSExtValue()); - APInt Minus1(128, (uint64_t)-1, true); + APInt Minus1(128, static_cast<uint64_t>(-1), true); EXPECT_EQ(0u, Minus1.countLeadingZeros()); EXPECT_EQ(128u, Minus1.countLeadingOnes()); EXPECT_EQ(128u, Minus1.getActiveBits()); @@ -54,7 +54,7 @@ TEST(APIntTest, i128_NegativeCount) { } TEST(APIntTest, i33_Count) { - APInt i33minus2(33, -2, true); + APInt i33minus2(33, static_cast<uint64_t>(-2), true); EXPECT_EQ(0u, i33minus2.countLeadingZeros()); EXPECT_EQ(32u, i33minus2.countLeadingOnes()); EXPECT_EQ(33u, i33minus2.getActiveBits()); @@ -83,7 +83,7 @@ TEST(APIntTest, i128_PositiveCount) { EXPECT_EQ(128u, u128max.countTrailingOnes()); EXPECT_EQ(128u, u128max.countPopulation()); - APInt u64max(128, (uint64_t)-1, false); + APInt u64max(128, static_cast<uint64_t>(-1), false); EXPECT_EQ(64u, u64max.countLeadingZeros()); EXPECT_EQ(0u, u64max.countLeadingOnes()); EXPECT_EQ(64u, u64max.getActiveBits()); @@ -114,8 +114,8 @@ TEST(APIntTest, i128_PositiveCount) { } TEST(APIntTest, i1) { - const APInt neg_two(1, -2, true); - const APInt neg_one(1, -1, true); + const APInt neg_two(1, static_cast<uint64_t>(-2), true); + const APInt neg_one(1, static_cast<uint64_t>(-1), true); const APInt zero(1, 0); const APInt one(1, 1); const APInt two(1, 2); |