From 8ecd0616050dac55da42f743b6b9ee3c3d4381de Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 10 May 2017 18:15:06 +0000 Subject: [PATCH] [ConstantRange] Add test case showing a case where we pick too large of a range for multiply after r271020. llvm-svn: 302700 --- unittests/IR/ConstantRangeTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unittests/IR/ConstantRangeTest.cpp b/unittests/IR/ConstantRangeTest.cpp index b22f82154f4..6c5c8f50340 100644 --- a/unittests/IR/ConstantRangeTest.cpp +++ b/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) {