]> granicus.if.org Git - llvm/commitdiff
[ConstantRange] Add test case showing a case where we pick too large of a range for...
authorCraig Topper <craig.topper@gmail.com>
Wed, 10 May 2017 18:15:06 +0000 (18:15 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 10 May 2017 18:15:06 +0000 (18:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302700 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/IR/ConstantRangeTest.cpp

index b22f82154f40380c05bb623ec5d4f45b59c62a84..6c5c8f50340f535a2572f505b6b9cb73a3d88a79 100644 (file)
@@ -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) {