brintos

brintos / llvm-project-archived public Read only

0
0
Text · 716 B · ba59e28 Raw
30 lines · cpp
1// Tests trace pc guard coverage collection.2//3// REQUIRES: x86_64-linux4// XFAIL: tsan5//6// RUN: rm -rf %t_workdir7// RUN: mkdir -p %t_workdir8// RUN: cd %t_workdir9/// 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 %t12// RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s13// RUN: rm -rf %t_workdir14 15#include <stdio.h>16 17int foo() {18  fprintf(stderr, "foo\n");19  return 1;20}21 22int main() {23  fprintf(stderr, "main\n");24  foo();25  foo();26}27 28// CHECK: main29// CHECK: SanitizerCoverage: ./sanitizer_coverage_symbolize.{{.*}}.sancov: 2 PCs written30