aboutsummaryrefslogblamecommitdiff
path: root/test/lsan/TestCases/strace_test.cc
blob: b3568d0b44e8091cb1491d5f5006f595ce52920e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)