From b42729b53a061e2a3def61eb10e2a648cecd60ae Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Mon, 23 Jul 2012 20:33:29 +0000 Subject: make ConstantRange::zeroExtend() optimal git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160643 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/ConstantRangeTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'unittests') 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) { -- cgit v1.1