aboutsummaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-06-22 21:13:46 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-06-22 21:13:46 +0000
commite6240e8b83e9bd60e622650e9e801ebc957172b4 (patch)
tree0df58ebda06bf4ac235f9598dc73c8771d85cdaa /unittests
parentf78b5952c30b69c764ff48270eb56540a3fa56f3 (diff)
downloadexternal_llvm-e6240e8b83e9bd60e622650e9e801ebc957172b4.zip
external_llvm-e6240e8b83e9bd60e622650e9e801ebc957172b4.tar.gz
external_llvm-e6240e8b83e9bd60e622650e9e801ebc957172b4.tar.bz2
Fix the implementation of ConstantRange::sub(ConstantRange). Patch by Xi Wang!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/ConstantRangeTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp
index 161e2cf..742bcb4 100644
--- a/unittests/Support/ConstantRangeTest.cpp
+++ b/unittests/Support/ConstantRangeTest.cpp
@@ -299,6 +299,8 @@ TEST_F(ConstantRangeTest, Sub) {
EXPECT_EQ(Empty.sub(APInt(16, 4)), Empty);
EXPECT_EQ(Some.sub(APInt(16, 4)),
ConstantRange(APInt(16, 0x6), APInt(16, 0xaa6)));
+ EXPECT_EQ(Some.sub(Some),
+ ConstantRange(APInt(16, 0xf561), APInt(16, 0xaa0)));
EXPECT_EQ(Wrap.sub(APInt(16, 4)),
ConstantRange(APInt(16, 0xaa6), APInt(16, 0x6)));
EXPECT_EQ(One.sub(APInt(16, 4)),