Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / coverage-and-lsan.cpp
blob294de13ce19725c0bc8579c4ff1d6b3d710a8d58
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-dir
6 //
7 // RUN: mkdir -p %t-dir
8 // RUN: %env_asan_opts=coverage=1:coverage_dir=%t-dir:verbosity=1 not %run %t 2>&1 | FileCheck %s
9 // RUN: %sancov print %t-dir/*.sancov 2>&1
11 // REQUIRES: leak-detection
12 // FIXME: sancov paths not work with adb
13 // UNSUPPORTED: android
14 int *g;
15 int main(int argc, char **argv) {
16 for (int i = 0; i < 10; ++i)
17 g = new int[i];
18 return 0;
21 // CHECK: LeakSanitizer: detected memory leaks
22 // CHECK: SanitizerCoverage: {{.*}}PCs written