Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / sanitizer_coverage_symbolize.cpp
blobba59e28f688a717189e555fed91c6d21caef24d7
1 // Tests trace pc guard coverage collection.
2 //
3 // REQUIRES: x86_64-linux
4 // XFAIL: tsan
5 //
6 // RUN: rm -rf %t_workdir
7 // RUN: mkdir -p %t_workdir
8 // RUN: cd %t_workdir
9 /// In glibc 2.39+, fprintf has a nonnull attribute. Disable nonnull-attribute,
10 /// which would increase counters for ubsan.
11 // RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard -fno-sanitize=nonnull-attribute %s -o %t
12 // RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s
13 // RUN: rm -rf %t_workdir
15 #include <stdio.h>
17 int foo() {
18 fprintf(stderr, "foo\n");
19 return 1;
22 int main() {
23 fprintf(stderr, "main\n");
24 foo();
25 foo();
28 // CHECK: main
29 // CHECK: SanitizerCoverage: ./sanitizer_coverage_symbolize.{{.*}}.sancov: 2 PCs written