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 | 680336d12f58c6f0605b0a16fcf6c37515b0d8ac (patch) | |
| tree | a6ce6725ac3b0d614cd692c62e76b7f07dc1b4c6 /llvm | |
| parent | b53c0c29c04db505ffe1feba0f7f7ba409566eba (diff) | |
| download | bcm5719-llvm-680336d12f58c6f0605b0a16fcf6c37515b0d8ac.tar.gz bcm5719-llvm-680336d12f58c6f0605b0a16fcf6c37515b0d8ac.zip  | |
* Fixed calls to APInt ctor to work for negative values on Darwin/x86
* Converted C-style casts to C++-style casts
llvm-svn: 68613
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/unittests/ADT/APIntTest.cpp | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp index bb54cd935d7..dcafae2fee8 100644 --- a/llvm/unittests/ADT/APIntTest.cpp +++ b/llvm/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);  | 

