[PATCH] D73515: [asan] Fix test compilation on Android API <= 17

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 17:27:33 PST 2020


smeenai created this revision.
smeenai added reviewers: kcc, pcc, danalbert.
Herald added subscribers: llvm-commits, Sanitizers, krytarowski.
Herald added projects: Sanitizers, LLVM.

mlockall and munlockall were introduced in Android API 17, so avoid
referencing them on prior versions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73515

Files:
  compiler-rt/lib/asan/tests/asan_test.cpp


Index: compiler-rt/lib/asan/tests/asan_test.cpp
===================================================================
--- compiler-rt/lib/asan/tests/asan_test.cpp
+++ compiler-rt/lib/asan/tests/asan_test.cpp
@@ -1157,9 +1157,13 @@
 
 #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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73515.240740.patch
Type: text/x-patch
Size: 587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200128/d30625aa/attachment.bin>


More information about the llvm-commits mailing list