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 @@ -1,4 +1,4 @@ -//===-- common_test.cpp ---------------------------------------*- C++ -*-===// +//===-- common_test.cpp -----------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -16,6 +16,9 @@ namespace scudo { static uptr getResidentMemorySize() { +#if !SCUDO_LINUX + UNREACHABLE("Not implemented!"); +#endif uptr Size; uptr Resident; std::ifstream IFS("/proc/self/statm"); @@ -32,7 +35,7 @@ const uptr Size = 1ull << 30; const uptr Threshold = Size >> 3; - MapPlatformData Data; + MapPlatformData Data = {}; uptr *P = reinterpret_cast( map(nullptr, Size, "ResidentMemorySize", 0, &Data)); const uptr N = Size / sizeof(*P); @@ -47,8 +50,7 @@ releasePagesToOS((uptr)P, 0, Size, &Data); EXPECT_EQ(std::count(P, P + N, 0), N); // FIXME: does not work with QEMU-user. - // EXPECT_LT(getResidentMemorySize() - OnStart, Threshold) << OnStart << " " - // << getResidentMemorySize(); + // EXPECT_LT(getResidentMemorySize() - OnStart, Threshold); memset(P, 1, Size); EXPECT_EQ(std::count(P, P + N, 0), 0);