forked from OSchip/llvm-project
[asan] make sure coverage is dumped even if leaks are reported
llvm-svn: 219946
This commit is contained in:
parent
15558914ab
commit
87b70fc823
|
@ -451,8 +451,11 @@ void DoLeakCheck() {
|
|||
PrintMatchedSuppressions();
|
||||
if (unsuppressed_count > 0) {
|
||||
param.leak_report.PrintSummary();
|
||||
if (flags()->exitcode)
|
||||
if (flags()->exitcode) {
|
||||
if (common_flags()->coverage)
|
||||
__sanitizer_cov_dump();
|
||||
internal__exit(flags()->exitcode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
// Make sure coverage is dumped even if there are reported leaks.
|
||||
//
|
||||
// RUN: %clangxx_asan -mllvm -asan-coverage=1 %s -o %t
|
||||
//
|
||||
// RUN: rm -rf %T/coverage-and-lsan
|
||||
//
|
||||
// RUN: mkdir -p %T/coverage-and-lsan/normal
|
||||
// RUN: ASAN_OPTIONS=coverage=1:coverage_dir=%T/coverage-and-lsan:verbosity=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %sancov print %T/coverage-and-lsan/*.sancov 2>&1
|
||||
//
|
||||
// REQUIRES: asan-64-bits
|
||||
|
||||
int *g = new int;
|
||||
int main(int argc, char **argv) {
|
||||
g = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// CHECK: LeakSanitizer: detected memory leaks
|
||||
// CHECK: CovDump:
|
Loading…
Reference in New Issue