diff --git a/compiler-rt/lib/scudo/standalone/tests/common_test.cpp b/compiler-rt/lib/scudo/standalone/tests/common_test.cpp --- a/compiler-rt/lib/scudo/standalone/tests/common_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/common_test.cpp @@ -27,7 +27,7 @@ // Fuchsia needs getResidentMemorySize implementation. TEST(ScudoCommonTest, SKIP_ON_FUCHSIA(ResidentMemorySize)) { uptr OnStart = getResidentMemorySize(); - EXPECT_GT(OnStart, 0); + EXPECT_GT(OnStart, 0UL); const uptr Size = 1ull << 30; const uptr Threshold = Size >> 3; @@ -35,9 +35,9 @@ MapPlatformData Data; uptr *P = reinterpret_cast( map(nullptr, Size, "ResidentMemorySize", 0, &Data)); - const uptr N = Size / sizeof(*P); + const size_t N = Size / sizeof(*P); ASSERT_NE(nullptr, P); - EXPECT_EQ(std::count(P, P + N, 0), N); + EXPECT_EQ((size_t)std::count(P, P + N, 0), N); EXPECT_LT(getResidentMemorySize() - OnStart, Threshold); memset(P, 1, Size); @@ -45,7 +45,7 @@ EXPECT_LT(getResidentMemorySize() - Size, Threshold); releasePagesToOS((uptr)P, 0, Size, &Data); - EXPECT_EQ(std::count(P, P + N, 0), N); + EXPECT_EQ((size_t)std::count(P, P + N, 0), N); // FIXME: does not work with QEMU-user. // EXPECT_LT(getResidentMemorySize() - OnStart, Threshold) << OnStart << " " // << getResidentMemorySize(); @@ -55,4 +55,4 @@ EXPECT_LT(getResidentMemorySize() - Size, Threshold); } -} // namespace scudo \ No newline at end of file +} // namespace scudo