llvm.org GIT mirror llvm / 843f0af
[ConstantRange] Add another truncate unittest for wrapped set staying a wrapped set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304695 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 2 years ago
1 changed file(s) with 4 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
199199 // trunc([5, 7), 3->2) = [1, 3)
200200 ConstantRange FiveSeven(APInt(3, 5), APInt(3, 7));
201201 EXPECT_EQ(FiveSeven.truncate(2), ConstantRange(APInt(2, 1), APInt(2, 3)));
202
203 // trunc([7, 1), 3->2) = [3, 1)
204 ConstantRange SevenOne(APInt(3, 7), APInt(3, 1));
205 EXPECT_EQ(SevenOne.truncate(2), ConstantRange(APInt(2, 3), APInt(2, 1)));
202206 }
203207
204208 TEST_F(ConstantRangeTest, ZExt) {