summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-05-10 18:15:06 +0000
committerCraig Topper <craig.topper@gmail.com>2017-05-10 18:15:06 +0000
commit9bbae50d83db2856f0cb27adb16123d2f80a5789 (patch)
tree30592947b57498db11086cee060647ded134fd41 /llvm
parent197685c6d8977135c227bd62c38f34106809b9d2 (diff)
downloadbcm5719-llvm-9bbae50d83db2856f0cb27adb16123d2f80a5789.tar.gz
bcm5719-llvm-9bbae50d83db2856f0cb27adb16123d2f80a5789.zip
[ConstantRange] Add test case showing a case where we pick too large of a range for multiply after r271020.
llvm-svn: 302700
Diffstat (limited to 'llvm')
-rw-r--r--llvm/unittests/IR/ConstantRangeTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/IR/ConstantRangeTest.cpp b/llvm/unittests/IR/ConstantRangeTest.cpp
index b22f82154f4..6c5c8f50340 100644
--- a/llvm/unittests/IR/ConstantRangeTest.cpp
+++ b/llvm/unittests/IR/ConstantRangeTest.cpp
@@ -443,6 +443,11 @@ TEST_F(ConstantRangeTest, Multiply) {
EXPECT_EQ(ConstantRange(APInt(8, 254), APInt(8, 255)).multiply(
ConstantRange(APInt(8, 2), APInt(8, 4))),
ConstantRange(APInt(8, 250), APInt(8, 253)));
+
+ // TODO: This should be return [-2, 0]
+ EXPECT_EQ(ConstantRange(APInt(8, -2)).multiply(
+ ConstantRange(APInt(8, 0), APInt(8, 2))),
+ ConstantRange(APInt(8, 0), APInt(8, 255)));
}
TEST_F(ConstantRangeTest, UMax) {
OpenPOWER on IntegriCloud