1 // Make sure coverage is dumped even if there are reported leaks.
2 //
3 // RUN: %clangxx_asan -fsanitize-coverage=func %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: CovDump:
21