summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR/ConstantRangeTest.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-04 23:07:53 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-04 23:07:53 +0000
commit4b31ffd147545c3f81ddfadce89c85f48d71c230 (patch)
tree7ff784e34a9cb44c91e19d725445a140c4a5e465 /llvm/unittests/IR/ConstantRangeTest.cpp
parent0be7a1badbbcdfde398eb15d1a309699bee52630 (diff)
downloadbcm5719-llvm-4b31ffd147545c3f81ddfadce89c85f48d71c230.tar.gz
bcm5719-llvm-4b31ffd147545c3f81ddfadce89c85f48d71c230.zip
[ConstantRange] Add another truncate unittest for wrapped set staying a wrapped set.
llvm-svn: 304695
Diffstat (limited to 'llvm/unittests/IR/ConstantRangeTest.cpp')
-rw-r--r--llvm/unittests/IR/ConstantRangeTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/unittests/IR/ConstantRangeTest.cpp b/llvm/unittests/IR/ConstantRangeTest.cpp
index c6a0ef8f1b7..0292f60fe33 100644
--- a/llvm/unittests/IR/ConstantRangeTest.cpp
+++ b/llvm/unittests/IR/ConstantRangeTest.cpp
@@ -200,6 +200,10 @@ TEST_F(ConstantRangeTest, Trunc) {
// trunc([5, 7), 3->2) = [1, 3)
ConstantRange FiveSeven(APInt(3, 5), APInt(3, 7));
EXPECT_EQ(FiveSeven.truncate(2), ConstantRange(APInt(2, 1), APInt(2, 3)));
+
+ // trunc([7, 1), 3->2) = [3, 1)
+ ConstantRange SevenOne(APInt(3, 7), APInt(3, 1));
+ EXPECT_EQ(SevenOne.truncate(2), ConstantRange(APInt(2, 3), APInt(2, 1)));
}
TEST_F(ConstantRangeTest, ZExt) {
OpenPOWER on IntegriCloud