From 21adc2decaa82ac42ad4c742fdf0391c8de61293 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302700 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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) { -- 2.50.1