again to Daniel Dunbar and KLEE!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75449
91177308-0d34-0410-b5e6-
96231b3b80d8
else
return SignedMax;
} else {
- if ((getUpper() - 1).slt(getLower())) {
- if (getLower() != SignedMax)
- return SignedMax;
- else
- return getUpper() - 1;
- } else {
+ if (getLower().isNegative() == getUpper().isNegative())
+ return SignedMax;
+ else
return getUpper() - 1;
- }
}
}
EXPECT_EQ(One.getSignedMin(), APInt(16, 0xa));
EXPECT_EQ(Some.getSignedMin(), APInt(16, 0xa));
EXPECT_EQ(Wrap.getSignedMin(), APInt(16, INT16_MIN));
+
+ // Found by Klee
+ EXPECT_EQ(ConstantRange(APInt(4, 7), APInt(4, 0)).getSignedMax(),
+ APInt(4, 7));
}
TEST_F(ConstantRangeTest, Trunc) {