diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2013-10-30 15:36:50 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2013-10-30 15:36:50 +0000 |
commit | d3b64efcb33415e980035371b3e8de1e501a6f12 (patch) | |
tree | d4fecab21ac4aef567387698868d03605b51f601 /unittests | |
parent | c385709d8397ca1535481c04564b67d07c66c619 (diff) | |
download | external_llvm-d3b64efcb33415e980035371b3e8de1e501a6f12.zip external_llvm-d3b64efcb33415e980035371b3e8de1e501a6f12.tar.gz external_llvm-d3b64efcb33415e980035371b3e8de1e501a6f12.tar.bz2 |
make ConstantRange::signExtend() optimal
the case [x, INT_MIN) was not handled optimally
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/ConstantRangeTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp index 4d6bbf6..3e0a085 100644 --- a/unittests/Support/ConstantRangeTest.cpp +++ b/unittests/Support/ConstantRangeTest.cpp @@ -216,6 +216,9 @@ TEST_F(ConstantRangeTest, SExt) { EXPECT_EQ(ConstantRange(APInt(8, 120), APInt(8, 140)).signExtend(16), ConstantRange(APInt(16, -128), APInt(16, 128))); + + EXPECT_EQ(ConstantRange(APInt(16, 0x0200), APInt(16, 0x8000)).signExtend(19), + ConstantRange(APInt(19, 0x0200), APInt(19, 0x8000))); } TEST_F(ConstantRangeTest, IntersectWith) { |