Multiply was very wrong for wrapped ranges. This supplies a half-fix that will

generally return Full on all wrapped inputs. "Fixes" PR4545.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75444 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2009-07-13 03:27:41 +00:00
parent cf9e07dea8
commit f1db120d04
2 changed files with 11 additions and 6 deletions

View File

@ -275,6 +275,11 @@ TEST_F(ConstantRangeTest, Multiply) {
EXPECT_TRUE(Some.multiply(Some).isFullSet());
EXPECT_EQ(Some.multiply(Wrap), Full);
EXPECT_EQ(Wrap.multiply(Wrap), Full);
// http://llvm.org/PR4545
EXPECT_EQ(ConstantRange(APInt(4, 1), APInt(4, 6)).multiply(
ConstantRange(APInt(4, 6), APInt(4, 2))),
ConstantRange(4, /*isFullSet=*/true));
}
TEST_F(ConstantRangeTest, UMax) {