[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Linux / mlock_test.cpp
blob09b05d1a44434e4684404918e81898479da97beb
1 // Test that sanitizers suppress mlock.
2 // RUN: %clang %s -o %t && %run %t
4 // No shadow, so no need to disable mlock.
5 // XFAIL: ubsan, lsan
7 // FIXME: Implement.
8 // XFAIL: hwasan
10 #include <assert.h>
11 #include <sys/mman.h>
13 int main() {
14 #if defined(__has_feature)
15 # if __has_feature(hwaddress_sanitizer)
16 // Don't mlock, it may claim all memory.
17 abort();
18 # endif
19 #endif
20 assert(0 == mlockall(MCL_CURRENT));
21 assert(0 == mlock((void *)0x12345, 0x5678));
22 assert(0 == munlockall());
23 assert(0 == munlock((void *)0x987, 0x654));