fix a off-by-one bug in intersectWith(), and add a bunch of tests
[oota-llvm.git] / lib / Support / ConstantRange.cpp
index e7d848312809318c39cd849bd67b3b7ed8453005..61d333f24a0f092081d7707e3b7fc888c36ede8c 100644 (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;