[llvm] 41bdcaa - [ADT] APIntTest - use APInt::getMaxValue/getSignedMinValue/getSignedMaxValue instead of raw (U)INT_MAX/MIN defines
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 15 04:46:36 PDT 2024
Author: Simon Pilgrim
Date: 2024-03-15T11:46:22Z
New Revision: 41bdcaa7c687140c28ad46102784bb6c40449981
URL: https://github.com/llvm/llvm-project/commit/41bdcaa7c687140c28ad46102784bb6c40449981
DIFF: https://github.com/llvm/llvm-project/commit/41bdcaa7c687140c28ad46102784bb6c40449981.diff
LOG: [ADT] APIntTest - use APInt::getMaxValue/getSignedMinValue/getSignedMaxValue instead of raw (U)INT_MAX/MIN defines
Fixes warnings on MSVC builds
Added:
Modified:
llvm/unittests/ADT/APIntTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp
index 6aec1049584bbe..83cbb02e0f58b3 100644
--- a/llvm/unittests/ADT/APIntTest.cpp
+++ b/llvm/unittests/ADT/APIntTest.cpp
@@ -2919,7 +2919,7 @@ TEST(APIntTest, Average) {
APInt A100(32, 100);
APInt A101(32, 101);
APInt A200(32, 200, false);
- APInt ApUMax(32, UINT_MAX, false);
+ APInt ApUMax = APInt::getMaxValue(32);
EXPECT_EQ(APInt(32, 150), APIntOps::avgFloorU(A100, A200));
EXPECT_EQ(APIntOps::RoundingUDiv(A100 + A200, A2, APInt::Rounding::DOWN),
@@ -2946,8 +2946,8 @@ TEST(APIntTest, Average) {
APInt Am100(32, -100);
APInt Am101(32, -101);
APInt Am200(32, -200);
- APInt AmSMin(32, INT_MIN);
- APInt ApSMax(32, INT_MAX);
+ APInt AmSMin = APInt::getSignedMinValue(32);
+ APInt ApSMax = APInt::getSignedMaxValue(32);
EXPECT_EQ(APInt(32, +150), APIntOps::avgFloorS(Ap100, Ap200));
EXPECT_EQ(APIntOps::RoundingSDiv(Ap100 + Ap200, A2, APInt::Rounding::DOWN),
More information about the llvm-commits
mailing list