diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2010-09-28 18:18:36 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2010-09-28 18:18:36 +0000 |
commit | 5154ee0bca72c6decffab014163d61c0f5a526c6 (patch) | |
tree | 31609083585c7deb5432fa07b3a9f0c29208dd22 /llvm/unittests/Support/ConstantRangeTest.cpp | |
parent | 7bfa53855129fd7c07f74b0b34237261b8066d0c (diff) | |
download | bcm5719-llvm-5154ee0bca72c6decffab014163d61c0f5a526c6.tar.gz bcm5719-llvm-5154ee0bca72c6decffab014163d61c0f5a526c6.zip |
Make ConstantRange::makeICmpRegion handle all the edge cases properly. This
also fixes PR8250.
llvm-svn: 114972
Diffstat (limited to 'llvm/unittests/Support/ConstantRangeTest.cpp')
-rw-r--r-- | llvm/unittests/Support/ConstantRangeTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ConstantRangeTest.cpp b/llvm/unittests/Support/ConstantRangeTest.cpp index 1cedeae50af..19ef9557f45 100644 --- a/llvm/unittests/Support/ConstantRangeTest.cpp +++ b/llvm/unittests/Support/ConstantRangeTest.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/ConstantRange.h" +#include "llvm/Instructions.h" #include "gtest/gtest.h" @@ -429,4 +430,11 @@ TEST_F(ConstantRangeTest, Lshr) { EXPECT_EQ(Wrap.lshr(Wrap), Full); } +TEST(ConstantRange, MakeICmpRegion) { + // PR8250 + ConstantRange SMax = ConstantRange(APInt::getSignedMaxValue(32)); + EXPECT_TRUE(ConstantRange::makeICmpRegion(ICmpInst::ICMP_SGT, + SMax).isEmptySet()); +} + } // anonymous namespace |