]> git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/asan/TestCases/coverage-and-lsan.cc
New upstream version 1.25.0+dfsg1
[rustc.git] / src / libcompiler_builtins / compiler-rt / test / asan / TestCases / coverage-and-lsan.cc
1 // Make sure coverage is dumped even if there are reported leaks.
2 //
3 // RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %t
4 //
5 // RUN: rm -rf %T/coverage-and-lsan
6 //
7 // RUN: mkdir -p %T/coverage-and-lsan/normal
8 // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-and-lsan:verbosity=1 not %run %t 2>&1 | FileCheck %s
9 // RUN: %sancov print %T/coverage-and-lsan/*.sancov 2>&1
10 //
11 // REQUIRES: leak-detection
12
13 int *g = new int;
14 int main(int argc, char **argv) {
15 g = 0;
16 return 0;
17 }
18
19 // CHECK: LeakSanitizer: detected memory leaks
20 // CHECK: SanitizerCoverage: {{.*}}PCs written