]> git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/lsan/TestCases/strace_test.cc
New upstream version 1.19.0+dfsg3
[rustc.git] / src / compiler-rt / test / lsan / TestCases / strace_test.cc
1 // Test that lsan reports a proper error when running under strace.
2 // REQUIRES: strace
3 // RUN: %clangxx_lsan %s -o %t
4 // RUN: not strace -o /dev/null %run %t 2>&1 | FileCheck %s
5
6 #include <stdio.h>
7 #include <stdlib.h>
8
9 static volatile void *sink;
10
11 int main() {
12 sink = malloc(42);
13 }
14 // CHECK: LeakSanitizer has encountered a fatal error
15 // CHECK: HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)