[llvm] 57d3e9c - [NFC][ML] Avoid source of some signed/unsigned warnings in TFUtilsTest
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 17 09:07:13 PDT 2020
Author: Mircea Trofin
Date: 2020-10-17T09:07:02-07:00
New Revision: 57d3e9cd9bca9d71699abc9fb81862e2d80533dd
URL: https://github.com/llvm/llvm-project/commit/57d3e9cd9bca9d71699abc9fb81862e2d80533dd
DIFF: https://github.com/llvm/llvm-project/commit/57d3e9cd9bca9d71699abc9fb81862e2d80533dd.diff
LOG: [NFC][ML] Avoid source of some signed/unsigned warnings in TFUtilsTest
Added:
Modified:
llvm/unittests/Analysis/TFUtilsTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Analysis/TFUtilsTest.cpp b/llvm/unittests/Analysis/TFUtilsTest.cpp
index 3b62e33999d9..d2ad977545ad 100644
--- a/llvm/unittests/Analysis/TFUtilsTest.cpp
+++ b/llvm/unittests/Analysis/TFUtilsTest.cpp
@@ -57,7 +57,7 @@ TEST(TFUtilsTest, LoadAndExecuteTest) {
auto ER = Evaluator.evaluate();
EXPECT_TRUE(ER.hasValue());
float Ret = *ER->getTensorValue<float>(0);
- EXPECT_EQ(static_cast<size_t>(Ret), 80);
+ EXPECT_EQ(static_cast<int64_t>(Ret), 80);
EXPECT_EQ(ER->getUntypedTensorValue(0),
reinterpret_cast<const void *>(ER->getTensorValue<float>(0)));
}
@@ -72,7 +72,7 @@ TEST(TFUtilsTest, LoadAndExecuteTest) {
auto ER = Evaluator.evaluate();
EXPECT_TRUE(ER.hasValue());
float Ret = *ER->getTensorValue<float>(0);
- EXPECT_EQ(static_cast<size_t>(Ret), 80);
+ EXPECT_EQ(static_cast<int64_t>(Ret), 80);
}
}
@@ -135,10 +135,10 @@ TEST(TFUtilsTest, TensorSpecSizesAndTypes) {
auto Spec3DLarge = TensorSpec::createSpec<float>("Hi3", {2, 4, 10});
EXPECT_TRUE(Spec1D.isElementType<int16_t>());
EXPECT_FALSE(Spec3DLarge.isElementType<double>());
- EXPECT_EQ(Spec1D.getElementCount(), 1);
- EXPECT_EQ(Spec2D.getElementCount(), 1);
- EXPECT_EQ(Spec1DLarge.getElementCount(), 10);
- EXPECT_EQ(Spec3DLarge.getElementCount(), 80);
+ EXPECT_EQ(Spec1D.getElementCount(), 1U);
+ EXPECT_EQ(Spec2D.getElementCount(), 1U);
+ EXPECT_EQ(Spec1DLarge.getElementCount(), 10U);
+ EXPECT_EQ(Spec3DLarge.getElementCount(), 80U);
EXPECT_EQ(Spec3DLarge.getElementByteSize(), sizeof(float));
EXPECT_EQ(Spec1D.getElementByteSize(), sizeof(int16_t));
}
More information about the llvm-commits
mailing list