aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/Support
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-07-13 03:27:41 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-07-13 03:27:41 +0000
commitf1db120d0494ec55d9265cea7dab22e80dcae10c (patch)
tree9f4f1b55e931c834af75ad37649a7b9e689c2516 /unittests/Support
parentcf9e07dea8aad32c5e7e2631d135566b20e1763c (diff)
downloadexternal_llvm-f1db120d0494ec55d9265cea7dab22e80dcae10c.zip
external_llvm-f1db120d0494ec55d9265cea7dab22e80dcae10c.tar.gz
external_llvm-f1db120d0494ec55d9265cea7dab22e80dcae10c.tar.bz2
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
Diffstat (limited to 'unittests/Support')
-rw-r--r--unittests/Support/ConstantRangeTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp
index cd91a9e..2b073d8 100644
--- a/unittests/Support/ConstantRangeTest.cpp
+++ b/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) {