Skip to content

Commit 41bdcaa

Browse files
committed
[ADT] APIntTest - use APInt::getMaxValue/getSignedMinValue/getSignedMaxValue instead of raw (U)INT_MAX/MIN defines
Fixes warnings on MSVC builds
1 parent e12b46f commit 41bdcaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/unittests/ADT/APIntTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2919,7 +2919,7 @@ TEST(APIntTest, Average) {
29192919
APInt A100(32, 100);
29202920
APInt A101(32, 101);
29212921
APInt A200(32, 200, false);
2922-
APInt ApUMax(32, UINT_MAX, false);
2922+
APInt ApUMax = APInt::getMaxValue(32);
29232923

29242924
EXPECT_EQ(APInt(32, 150), APIntOps::avgFloorU(A100, A200));
29252925
EXPECT_EQ(APIntOps::RoundingUDiv(A100 + A200, A2, APInt::Rounding::DOWN),
@@ -2946,8 +2946,8 @@ TEST(APIntTest, Average) {
29462946
APInt Am100(32, -100);
29472947
APInt Am101(32, -101);
29482948
APInt Am200(32, -200);
2949-
APInt AmSMin(32, INT_MIN);
2950-
APInt ApSMax(32, INT_MAX);
2949+
APInt AmSMin = APInt::getSignedMinValue(32);
2950+
APInt ApSMax = APInt::getSignedMaxValue(32);
29512951

29522952
EXPECT_EQ(APInt(32, +150), APIntOps::avgFloorS(Ap100, Ap200));
29532953
EXPECT_EQ(APIntOps::RoundingSDiv(Ap100 + Ap200, A2, APInt::Rounding::DOWN),

0 commit comments

Comments
 (0)