summaryrefslogtreecommitdiff
path: root/test/fuzzer/coverage.test
blob: 83a4b12cbcfb306e0475c3f8ecd0711e73985f50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
UNSUPPORTED: aarch64
RUN: %cpp_compiler -mllvm -use-unknown-locations=Disable  %S/NullDerefTest.cpp -o %t-NullDerefTest
RUN: %cpp_compiler -mllvm -use-unknown-locations=Disable %S/DSO1.cpp -fPIC %ld_flags_rpath_so1 -shared -o %dynamiclib1
RUN: %cpp_compiler -mllvm -use-unknown-locations=Disable %S/DSO2.cpp -fPIC %ld_flags_rpath_so2 -shared -o %dynamiclib2
RUN: %cpp_compiler -mllvm -use-unknown-locations=Disable %S/DSOTestMain.cpp %S/DSOTestExtra.cpp %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t-DSOTest

CHECK: COVERAGE:
CHECK: COVERED_FUNC: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:13
RUN: not %run %t-NullDerefTest -print_coverage=1 2>&1 | FileCheck %s

RUN: %run %t-DSOTest -print_coverage=1 -runs=0 2>&1 | FileCheck %s --check-prefix=DSO
DSO: COVERAGE:
DSO-DAG: COVERED_FUNC:{{.*}}1{{.*}}
DSO-DAG: COVERED_FUNC:{{.*}}2{{.*}}
DSO-DAG: COVERED_FUNC:{{.*}}LLVMFuzzerTestOneInput{{.*}}DSOTestMain
DSO-DAG: UNCOVERED_PC:{{.*}}1
DSO-DAG: UNCOVERED_PC:{{.*}}2
DSO-DAG: UNCOVERED_PC:{{.*}}DSOTestMain