mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:40:38 +00:00
[ConstantRange] Add a few more truncate unittests.
llvm-svn: 304694
This commit is contained in:
parent
e3e4e5fe38
commit
3c3b867d31
@ -188,6 +188,18 @@ TEST_F(ConstantRangeTest, Trunc) {
|
|||||||
One.getUpper().trunc(10)));
|
One.getUpper().trunc(10)));
|
||||||
EXPECT_TRUE(TSome.isFullSet());
|
EXPECT_TRUE(TSome.isFullSet());
|
||||||
EXPECT_TRUE(TWrap.isFullSet());
|
EXPECT_TRUE(TWrap.isFullSet());
|
||||||
|
|
||||||
|
// trunc([2, 5), 3->2) = [2, 1)
|
||||||
|
ConstantRange TwoFive(APInt(3, 2), APInt(3, 5));
|
||||||
|
EXPECT_EQ(TwoFive.truncate(2), ConstantRange(APInt(2, 2), APInt(2, 1)));
|
||||||
|
|
||||||
|
// trunc([2, 6), 3->2) = full
|
||||||
|
ConstantRange TwoSix(APInt(3, 2), APInt(3, 6));
|
||||||
|
EXPECT_TRUE(TwoSix.truncate(2).isFullSet());
|
||||||
|
|
||||||
|
// 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)));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ConstantRangeTest, ZExt) {
|
TEST_F(ConstantRangeTest, ZExt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user