diff options
Diffstat (limited to 'llvm/unittests/IR/ConstantRangeTest.cpp')
-rw-r--r-- | llvm/unittests/IR/ConstantRangeTest.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/llvm/unittests/IR/ConstantRangeTest.cpp b/llvm/unittests/IR/ConstantRangeTest.cpp index 8eca261..5fde024 100644 --- a/llvm/unittests/IR/ConstantRangeTest.cpp +++ b/llvm/unittests/IR/ConstantRangeTest.cpp @@ -1969,7 +1969,7 @@ TEST_F(ConstantRangeTest, UnsignedAddOverflow) { EXPECT_MAY_OVERFLOW(Empty.unsignedAddMayOverflow(Some)); // Never overflow despite one full/wrap set. - ConstantRange Zero(APInt::getNullValue(16)); + ConstantRange Zero(APInt::getZero(16)); EXPECT_NEVER_OVERFLOWS(Full.unsignedAddMayOverflow(Zero)); EXPECT_NEVER_OVERFLOWS(Wrap.unsignedAddMayOverflow(Zero)); EXPECT_NEVER_OVERFLOWS(Zero.unsignedAddMayOverflow(Full)); @@ -2003,8 +2003,8 @@ TEST_F(ConstantRangeTest, UnsignedSubOverflow) { EXPECT_MAY_OVERFLOW(Empty.unsignedSubMayOverflow(Some)); // Never overflow despite one full/wrap set. - ConstantRange Zero(APInt::getNullValue(16)); - ConstantRange Max(APInt::getAllOnesValue(16)); + ConstantRange Zero(APInt::getZero(16)); + ConstantRange Max(APInt::getAllOnes(16)); EXPECT_NEVER_OVERFLOWS(Full.unsignedSubMayOverflow(Zero)); EXPECT_NEVER_OVERFLOWS(Wrap.unsignedSubMayOverflow(Zero)); EXPECT_NEVER_OVERFLOWS(Max.unsignedSubMayOverflow(Full)); @@ -2038,7 +2038,7 @@ TEST_F(ConstantRangeTest, SignedAddOverflow) { EXPECT_MAY_OVERFLOW(Empty.signedAddMayOverflow(Some)); // Never overflow despite one full/wrap set. - ConstantRange Zero(APInt::getNullValue(16)); + ConstantRange Zero(APInt::getZero(16)); EXPECT_NEVER_OVERFLOWS(Full.signedAddMayOverflow(Zero)); EXPECT_NEVER_OVERFLOWS(Wrap.signedAddMayOverflow(Zero)); EXPECT_NEVER_OVERFLOWS(Zero.signedAddMayOverflow(Full)); @@ -2090,7 +2090,7 @@ TEST_F(ConstantRangeTest, SignedSubOverflow) { EXPECT_MAY_OVERFLOW(Empty.signedSubMayOverflow(Some)); // Never overflow despite one full/wrap set. - ConstantRange Zero(APInt::getNullValue(16)); + ConstantRange Zero(APInt::getZero(16)); EXPECT_NEVER_OVERFLOWS(Full.signedSubMayOverflow(Zero)); EXPECT_NEVER_OVERFLOWS(Wrap.signedSubMayOverflow(Zero)); @@ -2474,18 +2474,14 @@ TEST_F(ConstantRangeTest, binaryNot) { PreferSmallest); TestUnaryOpExhaustive( [](const ConstantRange &CR) { - return CR.binaryXor( - ConstantRange(APInt::getAllOnesValue(CR.getBitWidth()))); + return CR.binaryXor(ConstantRange(APInt::getAllOnes(CR.getBitWidth()))); }, - [](const APInt &N) { return ~N; }, - PreferSmallest); + [](const APInt &N) { return ~N; }, PreferSmallest); TestUnaryOpExhaustive( [](const ConstantRange &CR) { - return ConstantRange(APInt::getAllOnesValue(CR.getBitWidth())) - .binaryXor(CR); + return ConstantRange(APInt::getAllOnes(CR.getBitWidth())).binaryXor(CR); }, - [](const APInt &N) { return ~N; }, - PreferSmallest); + [](const APInt &N) { return ~N; }, PreferSmallest); } } // anonymous namespace |