mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
teach ConstantRange that zero times X is always zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160317 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -382,6 +382,14 @@ TEST_F(ConstantRangeTest, Multiply) {
|
||||
EXPECT_EQ(Some.multiply(Wrap), Full);
|
||||
EXPECT_EQ(Wrap.multiply(Wrap), Full);
|
||||
|
||||
ConstantRange Zero(APInt(16, 0));
|
||||
EXPECT_EQ(Zero.multiply(Full), Zero);
|
||||
EXPECT_EQ(Zero.multiply(Some), Zero);
|
||||
EXPECT_EQ(Zero.multiply(Wrap), Zero);
|
||||
EXPECT_EQ(Full.multiply(Zero), Zero);
|
||||
EXPECT_EQ(Some.multiply(Zero), Zero);
|
||||
EXPECT_EQ(Wrap.multiply(Zero), Zero);
|
||||
|
||||
// http://llvm.org/PR4545
|
||||
EXPECT_EQ(ConstantRange(APInt(4, 1), APInt(4, 6)).multiply(
|
||||
ConstantRange(APInt(4, 6), APInt(4, 2))),
|
||||
|
Reference in New Issue
Block a user