Fix signed/unsigned comparison warnings on ppc buildbots

This commit is contained in:
Simon Pilgrim 2022-02-08 13:55:01 +00:00
parent 9b8a93e3b6
commit 58f944cf0b
1 changed files with 6 additions and 6 deletions

View File

@ -1767,22 +1767,22 @@ TEST(APIntTest, isShiftedMask) {
APInt MaskVal = One.shl(I) - 1;
EXPECT_TRUE(MaskVal.isShiftedMask());
EXPECT_TRUE(MaskVal.isShiftedMask(MaskIdx, MaskLen));
EXPECT_EQ(0, MaskIdx);
EXPECT_EQ(I, MaskLen);
EXPECT_EQ(0, (int)MaskIdx);
EXPECT_EQ(I, (int)MaskLen);
}
for (int I = 1; I < N - 1; ++I) {
APInt MaskVal = One.shl(I);
EXPECT_TRUE(MaskVal.isShiftedMask());
EXPECT_TRUE(MaskVal.isShiftedMask(MaskIdx, MaskLen));
EXPECT_EQ(I, MaskIdx);
EXPECT_EQ(1, MaskLen);
EXPECT_EQ(I, (int)MaskIdx);
EXPECT_EQ(1, (int)MaskLen);
}
for (int I = 1; I < N; ++I) {
APInt MaskVal = APInt::getHighBitsSet(N, I);
EXPECT_TRUE(MaskVal.isShiftedMask());
EXPECT_TRUE(MaskVal.isShiftedMask(MaskIdx, MaskLen));
EXPECT_EQ(N - I, MaskIdx);
EXPECT_EQ(I, MaskLen);
EXPECT_EQ(N - I, (int)MaskIdx);
EXPECT_EQ(I, (int)MaskLen);
}
}
}