[compiler-rt] 8755d24 - [compiler-rt][ctx_profile] Fix signed-ness warnings in test
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Tue May 7 23:28:12 PDT 2024
Author: Mircea Trofin
Date: 2024-05-07T23:27:54-07:00
New Revision: 8755d24cb34b902557469445e1983850e0ce7cc7
URL: https://github.com/llvm/llvm-project/commit/8755d24cb34b902557469445e1983850e0ce7cc7
DIFF: https://github.com/llvm/llvm-project/commit/8755d24cb34b902557469445e1983850e0ce7cc7.diff
LOG: [compiler-rt][ctx_profile] Fix signed-ness warnings in test
Follow-up from PR ##89838. Some build bots warn-as-error
about signed/unsigned comparison in CtxInstrProfilingTest.
Example: https://lab.llvm.org/buildbot/#/builders/37/builds/34610
Added:
Modified:
compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp b/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp
index f6ebe6ab2e50c..1e96aea19ce47 100644
--- a/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp
+++ b/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp
@@ -178,19 +178,19 @@ TEST_F(ContextTest, Dump) {
bool write(const ContextNode &Node) {
EXPECT_FALSE(Root->Taken.TryLock());
- EXPECT_EQ(Node.guid(), 1);
+ EXPECT_EQ(Node.guid(), 1U);
EXPECT_EQ(Node.counters()[0], Entries);
- EXPECT_EQ(Node.counters_size(), 10);
- EXPECT_EQ(Node.callsites_size(), 4);
+ EXPECT_EQ(Node.counters_size(), 10U);
+ EXPECT_EQ(Node.callsites_size(), 4U);
EXPECT_EQ(Node.subContexts()[0], nullptr);
EXPECT_EQ(Node.subContexts()[1], nullptr);
EXPECT_NE(Node.subContexts()[2], nullptr);
EXPECT_EQ(Node.subContexts()[3], nullptr);
const auto &SN = *Node.subContexts()[2];
- EXPECT_EQ(SN.guid(), 2);
+ EXPECT_EQ(SN.guid(), 2U);
EXPECT_EQ(SN.counters()[0], Entries);
- EXPECT_EQ(SN.counters_size(), 3);
- EXPECT_EQ(SN.callsites_size(), 1);
+ EXPECT_EQ(SN.counters_size(), 3U);
+ EXPECT_EQ(SN.callsites_size(), 1U);
EXPECT_EQ(SN.subContexts()[0], nullptr);
State = true;
return true;
More information about the llvm-commits
mailing list