Skip to content

Commit 014c6b0

Browse files
committed
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
1 parent 56f03d2 commit 014c6b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ TEST(MemoryMapping, LoadedModuleArchAndUUID) {
7878
}
7979
}
8080

81+
# if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
82+
SANITIZER_SOLARIS) && \
83+
defined(_LP64)
8184
const char *const parse_unix_input = R"(
8285
7fb9862f1000-7fb9862f3000 rw-p 00000000 00:00 0
8386
Size: 8 kB
@@ -129,6 +132,7 @@ TEST(MemoryMapping, ParseUnixMemoryProfileTruncated) {
129132
}
130133
UnmapOrDie(mem, 2 * page);
131134
}
135+
# endif
132136

133137
} // namespace __sanitizer
134138
#endif // !defined(_WIN32)

0 commit comments

Comments
 (0)