aboutsummaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/Linux/mlock_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/sanitizer_common/TestCases/Linux/mlock_test.cc')
-rw-r--r--test/sanitizer_common/TestCases/Linux/mlock_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/Linux/mlock_test.cc b/test/sanitizer_common/TestCases/Linux/mlock_test.cc
new file mode 100644
index 000000000000..69ea7cb91c4f
--- /dev/null
+++ b/test/sanitizer_common/TestCases/Linux/mlock_test.cc
@@ -0,0 +1,13 @@
+// RUN: %clang %s -o %t && %run %t
+// XFAIL: lsan
+
+#include <assert.h>
+#include <sys/mman.h>
+
+int main() {
+ assert(0 == mlockall(MCL_CURRENT));
+ assert(0 == mlock((void *)0x12345, 0x5678));
+ assert(0 == munlockall());
+ assert(0 == munlock((void *)0x987, 0x654));
+}
+