fix a off-by-one bug in intersectWith(), and add a bunch of tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159319 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nuno Lopes
2012-06-28 00:59:33 +00:00
parent 58a6cf2c62
commit 532516a87b
2 changed files with 33 additions and 3 deletions

View File

@@ -316,7 +316,7 @@ ConstantRange ConstantRange::intersectWith(const ConstantRange &CR) const {
return CR;
}
if (CR.Upper.ult(Lower)) {
if (CR.Upper.ule(Lower)) {
if (CR.Lower.ult(Lower))
return *this;