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 | f2d7b7c879548090beae51b21c4b363da7dbbaad (patch) | |
tree | bd045e2df7d447337919528ebdb4ec565a94d4fe /unittests/Support/ConstantRangeTest.cpp | |
parent | 1a7ca0354a44e321d5f4839a73239e6eaec54ad5 (diff) |
Make ConstantRange::makeICmpRegion handle all the edge cases properly. This
also fixes PR8250.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/ConstantRangeTest.cpp')
-rw-r--r-- | unittests/Support/ConstantRangeTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp index 1cedeae50a..19ef9557f4 100644 --- a/unittests/Support/ConstantRangeTest.cpp +++ b/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 |