sanitizer_common: fix ParseUnixMemoryProfile test linking on Mac

The ParseUnixMemoryProfile function is defined only for a subset
of platforms. Define the test for the same set of platforms.

Also disable the test for 32-bit platforms b/c the pointer
values used in the test are 64-bit and don't fit into 32-bit uptr.

Reported-by: Jan Svoboda (jansvoboda11)

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112815
This commit is contained in:
Dmitry Vyukov 2021-10-29 15:50:39 +02:00
parent 56f03d25b4
commit 014c6b0736
1 changed files with 4 additions and 0 deletions

View File

@ -78,6 +78,9 @@ TEST(MemoryMapping, LoadedModuleArchAndUUID) {
}
}
# if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
SANITIZER_SOLARIS) && \
defined(_LP64)
const char *const parse_unix_input = R"(
7fb9862f1000-7fb9862f3000 rw-p 00000000 00:00 0
Size: 8 kB
@ -129,6 +132,7 @@ TEST(MemoryMapping, ParseUnixMemoryProfileTruncated) {
}
UnmapOrDie(mem, 2 * page);
}
# endif
} // namespace __sanitizer
#endif // !defined(_WIN32)