diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2009-07-13 03:27:41 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2009-07-13 03:27:41 +0000 |
| commit | 5302389442e928e7d8e9d07be1a4a463085d754a (patch) | |
| tree | 9f4f40ecf17cf09abd6002f1e4718820145092ab /llvm/unittests/Support | |
| parent | 73b704dd9c694d3c4641befa20fa00a7fee06065 (diff) | |
| download | bcm5719-llvm-5302389442e928e7d8e9d07be1a4a463085d754a.tar.gz bcm5719-llvm-5302389442e928e7d8e9d07be1a4a463085d754a.zip | |
Multiply was very wrong for wrapped ranges. This supplies a half-fix that will
generally return Full on all wrapped inputs. "Fixes" PR4545.
llvm-svn: 75444
Diffstat (limited to 'llvm/unittests/Support')
| -rw-r--r-- | llvm/unittests/Support/ConstantRangeTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ConstantRangeTest.cpp b/llvm/unittests/Support/ConstantRangeTest.cpp index cd91a9e103c..2b073d82039 100644 --- a/llvm/unittests/Support/ConstantRangeTest.cpp +++ b/llvm/unittests/Support/ConstantRangeTest.cpp @@ -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) { |

