diff options
Diffstat (limited to 'compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp')
| -rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp new file mode 100644 index 00000000000..daa994c8116 --- /dev/null +++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp @@ -0,0 +1,28 @@ +// Tests trace pc guard coverage collection. +// +// REQUIRES: x86_64-linux +// XFAIL: tsan +// +// RUN: DIR=%t_workdir +// RUN: rm -rf $DIR +// RUN: mkdir -p $DIR +// RUN: cd $DIR +// RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard %s -o %t +// RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s +// RUN: rm -rf $DIR + +#include <stdio.h> + +int foo() { + fprintf(stderr, "foo\n"); + return 1; +} + +int main() { + fprintf(stderr, "main\n"); + foo(); + foo(); +} + +// CHECK: main +// CHECK: SanitizerCoverage: ./sanitizer_coverage_symbolize.{{.*}}.sancov: 2 PCs written |

