summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-08-07 05:47:46 +0000
committerOwen Anderson <resistor@mac.com>2010-08-07 05:47:46 +0000
commit9773e45a1e97f5098905bac26b8b8b7c844473f0 (patch)
treedb9e2c980a9a3b752b6bb1e93e4cdd3877cbeefc /unittests
parentdbac071050010effb95febae0ddf72102551323d (diff)
downloadllvm-9773e45a1e97f5098905bac26b8b8b7c844473f0.tar.gz
llvm-9773e45a1e97f5098905bac26b8b8b7c844473f0.tar.bz2
llvm-9773e45a1e97f5098905bac26b8b8b7c844473f0.tar.xz
Add an inverse() method to ConstantRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/ConstantRangeTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp
index 6b8d01d553..fc1f5b8d06 100644
--- a/unittests/Support/ConstantRangeTest.cpp
+++ b/unittests/Support/ConstantRangeTest.cpp
@@ -33,6 +33,7 @@ ConstantRange ConstantRangeTest::Wrap(APInt(16, 0xaaa), APInt(16, 0xa));
TEST_F(ConstantRangeTest, Basics) {
EXPECT_TRUE(Full.isFullSet());
EXPECT_FALSE(Full.isEmptySet());
+ EXPECT_TRUE(Full.inverse().isEmptySet());
EXPECT_FALSE(Full.isWrappedSet());
EXPECT_TRUE(Full.contains(APInt(16, 0x0)));
EXPECT_TRUE(Full.contains(APInt(16, 0x9)));
@@ -42,6 +43,7 @@ TEST_F(ConstantRangeTest, Basics) {
EXPECT_FALSE(Empty.isFullSet());
EXPECT_TRUE(Empty.isEmptySet());
+ EXPECT_TRUE(Empty.inverse().isFullSet());
EXPECT_FALSE(Empty.isWrappedSet());
EXPECT_FALSE(Empty.contains(APInt(16, 0x0)));
EXPECT_FALSE(Empty.contains(APInt(16, 0x9)));
@@ -57,6 +59,7 @@ TEST_F(ConstantRangeTest, Basics) {
EXPECT_TRUE(One.contains(APInt(16, 0xa)));
EXPECT_FALSE(One.contains(APInt(16, 0xaa9)));
EXPECT_FALSE(One.contains(APInt(16, 0xaaa)));
+ EXPECT_FALSE(One.inverse().contains(APInt(16, 0xa)));
EXPECT_FALSE(Some.isFullSet());
EXPECT_FALSE(Some.isEmptySet());