summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2010-12-07 08:25:19 +0000
committerJay Foad <jay.foad@gmail.com>2010-12-07 08:25:19 +0000
commit40f8f6264d5af2c38e797e0dc59827cd231e8ff7 (patch)
tree3f3b576d6ec060c4063e4630d1ac4fad94997d82 /unittests
parent0ea112f104215ccba8d89c839cdeded6e3d49e59 (diff)
downloadllvm-40f8f6264d5af2c38e797e0dc59827cd231e8ff7.tar.gz
llvm-40f8f6264d5af2c38e797e0dc59827cd231e8ff7.tar.bz2
llvm-40f8f6264d5af2c38e797e0dc59827cd231e8ff7.tar.xz
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/ConstantRangeTest.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp
index 19ef9557f4..161e2cfb7e 100644
--- a/unittests/Support/ConstantRangeTest.cpp
+++ b/unittests/Support/ConstantRangeTest.cpp
@@ -171,8 +171,8 @@ TEST_F(ConstantRangeTest, Trunc) {
ConstantRange TWrap = Wrap.truncate(10);
EXPECT_TRUE(TFull.isFullSet());
EXPECT_TRUE(TEmpty.isEmptySet());
- EXPECT_EQ(TOne, ConstantRange(APInt(One.getLower()).trunc(10),
- APInt(One.getUpper()).trunc(10)));
+ EXPECT_EQ(TOne, ConstantRange(One.getLower().trunc(10),
+ One.getUpper().trunc(10)));
EXPECT_TRUE(TSome.isFullSet());
}
@@ -184,10 +184,10 @@ TEST_F(ConstantRangeTest, ZExt) {
ConstantRange ZWrap = Wrap.zeroExtend(20);
EXPECT_EQ(ZFull, ConstantRange(APInt(20, 0), APInt(20, 0x10000)));
EXPECT_TRUE(ZEmpty.isEmptySet());
- EXPECT_EQ(ZOne, ConstantRange(APInt(One.getLower()).zext(20),
- APInt(One.getUpper()).zext(20)));
- EXPECT_EQ(ZSome, ConstantRange(APInt(Some.getLower()).zext(20),
- APInt(Some.getUpper()).zext(20)));
+ EXPECT_EQ(ZOne, ConstantRange(One.getLower().zext(20),
+ One.getUpper().zext(20)));
+ EXPECT_EQ(ZSome, ConstantRange(Some.getLower().zext(20),
+ Some.getUpper().zext(20)));
EXPECT_EQ(ZWrap, ConstantRange(APInt(20, 0), APInt(20, 0x10000)));
}
@@ -200,10 +200,10 @@ TEST_F(ConstantRangeTest, SExt) {
EXPECT_EQ(SFull, ConstantRange(APInt(20, (uint64_t)INT16_MIN, true),
APInt(20, INT16_MAX + 1, true)));
EXPECT_TRUE(SEmpty.isEmptySet());
- EXPECT_EQ(SOne, ConstantRange(APInt(One.getLower()).sext(20),
- APInt(One.getUpper()).sext(20)));
- EXPECT_EQ(SSome, ConstantRange(APInt(Some.getLower()).sext(20),
- APInt(Some.getUpper()).sext(20)));
+ EXPECT_EQ(SOne, ConstantRange(One.getLower().sext(20),
+ One.getUpper().sext(20)));
+ EXPECT_EQ(SSome, ConstantRange(Some.getLower().sext(20),
+ Some.getUpper().sext(20)));
EXPECT_EQ(SWrap, ConstantRange(APInt(20, (uint64_t)INT16_MIN, true),
APInt(20, INT16_MAX + 1, true)));