summaryrefslogtreecommitdiff
path: root/unittests/IR/ConstantRangeTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/IR/ConstantRangeTest.cpp')
-rw-r--r--unittests/IR/ConstantRangeTest.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/unittests/IR/ConstantRangeTest.cpp b/unittests/IR/ConstantRangeTest.cpp
index b22f82154f40..c6c9bf6d6b50 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, -2), APInt(8, 1)));
}
TEST_F(ConstantRangeTest, UMax) {
@@ -703,13 +708,13 @@ TEST(ConstantRange, MakeGuaranteedNoWrapRegion) {
Instruction::Add, ConstantRange(32, /* isFullSet = */ true),
OBO::NoUnsignedWrap);
EXPECT_TRUE(NUWForAllValues.isSingleElement() &&
- NSWForAllValues.getSingleElement()->isMinValue());
+ NUWForAllValues.getSingleElement()->isMinValue());
auto NUWAndNSWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
Instruction::Add, ConstantRange(32, /* isFullSet = */ true),
OBO::NoUnsignedWrap | OBO::NoSignedWrap);
EXPECT_TRUE(NUWAndNSWForAllValues.isSingleElement() &&
- NSWForAllValues.getSingleElement()->isMinValue());
+ NUWAndNSWForAllValues.getSingleElement()->isMinValue());
ConstantRange OneToFive(APInt(32, 1), APInt(32, 6));
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(