[compiler-rt] d8f6950 - [asan] Fix test compilation on Android API <= 17
Shoaib Meenai via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 28 14:36:59 PST 2020
Author: Shoaib Meenai
Date: 2020-01-28T14:36:19-08:00
New Revision: d8f6950828df9959c84a659377214266d64be68e
URL: https://github.com/llvm/llvm-project/commit/d8f6950828df9959c84a659377214266d64be68e
DIFF: https://github.com/llvm/llvm-project/commit/d8f6950828df9959c84a659377214266d64be68e.diff
LOG: [asan] Fix test compilation on Android API <= 17
mlockall and munlockall were introduced in Android API 17, so avoid
referencing them on prior versions.
Differential Revision: https://reviews.llvm.org/D73515
Added:
Modified:
compiler-rt/lib/asan/tests/asan_test.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/tests/asan_test.cpp b/compiler-rt/lib/asan/tests/asan_test.cpp
index 47bba08cc23c..eb3ded3acc0e 100644
--- a/compiler-rt/lib/asan/tests/asan_test.cpp
+++ b/compiler-rt/lib/asan/tests/asan_test.cpp
@@ -1157,9 +1157,13 @@ TEST(AddressSanitizer, DISABLED_StressStackReuseAndExceptionsTest) {
#if !defined(_WIN32)
TEST(AddressSanitizer, MlockTest) {
+#if !defined(__ANDROID__) || __ANDROID_API__ >= 17
EXPECT_EQ(0, mlockall(MCL_CURRENT));
+#endif
EXPECT_EQ(0, mlock((void*)0x12345, 0x5678));
+#if !defined(__ANDROID__) || __ANDROID_API__ >= 17
EXPECT_EQ(0, munlockall());
+#endif
EXPECT_EQ(0, munlock((void*)0x987, 0x654));
}
#endif
More information about the llvm-commits
mailing list