summaryrefslogtreecommitdiff
path: root/test/lsan/TestCases/strace_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/lsan/TestCases/strace_test.cc')
-rw-r--r--test/lsan/TestCases/strace_test.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lsan/TestCases/strace_test.cc b/test/lsan/TestCases/strace_test.cc
new file mode 100644
index 0000000000000..b3568d0b44e80
--- /dev/null
+++ b/test/lsan/TestCases/strace_test.cc
@@ -0,0 +1,14 @@
+// Test that lsan reports a proper error when running under strace.
+// RUN: %clangxx_lsan %s -o %t
+// RUN: not strace -o /dev/null %run %t 2>&1 | FileCheck %s
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static volatile void *sink;
+
+int main() {
+ sink = malloc(42);
+}
+// CHECK: LeakSanitizer has encountered a fatal error
+// CHECK: HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)