diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-07-23 20:33:29 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-07-23 20:33:29 +0000 |
commit | b42729b53a061e2a3def61eb10e2a648cecd60ae (patch) | |
tree | b85c046d83efb6af717a2259dae2ecacd80a765e /unittests | |
parent | 5e31044e119c75899b91ca97eb4d8ba786afc01c (diff) | |
download | external_llvm-b42729b53a061e2a3def61eb10e2a648cecd60ae.zip external_llvm-b42729b53a061e2a3def61eb10e2a648cecd60ae.tar.gz external_llvm-b42729b53a061e2a3def61eb10e2a648cecd60ae.tar.bz2 |
make ConstantRange::zeroExtend() optimal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/ConstantRangeTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp index 7d4055f..263f93c 100644 --- a/unittests/Support/ConstantRangeTest.cpp +++ b/unittests/Support/ConstantRangeTest.cpp @@ -193,6 +193,10 @@ TEST_F(ConstantRangeTest, ZExt) { EXPECT_EQ(ZSome, ConstantRange(Some.getLower().zext(20), Some.getUpper().zext(20))); EXPECT_EQ(ZWrap, ConstantRange(APInt(20, 0), APInt(20, 0x10000))); + + // zext([5, 0), 3->7) = [5, 8) + ConstantRange FiveZero(APInt(3, 5), APInt(3, 0)); + EXPECT_EQ(FiveZero.zeroExtend(7), ConstantRange(APInt(7, 5), APInt(7, 8))); } TEST_F(ConstantRangeTest, SExt) { |