aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ConstantRangeTest.cpp
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
commit5dc6b794b15f5b21cd84601ad924fdb9530e97c9 (patch)
tree824aa9d79e3b0518d15081d71dc628f9ce75cc6b /llvm/unittests/Support/ConstantRangeTest.cpp
parent6cffdd2fd35e284f4dc90b732dddb89119fb27b4 (diff)
downloadllvm-5dc6b794b15f5b21cd84601ad924fdb9530e97c9.zip
llvm-5dc6b794b15f5b21cd84601ad924fdb9530e97c9.tar.gz
llvm-5dc6b794b15f5b21cd84601ad924fdb9530e97c9.tar.bz2
Fix the implementation of ConstantRange::sub(ConstantRange). Patch by Xi Wang!
llvm-svn: 133648
Diffstat (limited to 'llvm/unittests/Support/ConstantRangeTest.cpp')
-rw-r--r--llvm/unittests/Support/ConstantRangeTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ConstantRangeTest.cpp b/llvm/unittests/Support/ConstantRangeTest.cpp
index 161e2cf..742bcb4 100644
--- a/llvm/unittests/Support/ConstantRangeTest.cpp
+++ b/llvm/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)),