2018-09-05 01:08:47 +08:00
|
|
|
# FIXME: Disabled on Windows because -fPIC cannot be used to compile for Windows.
|
|
|
|
UNSUPPORTED: freebsd, windows
|
2018-06-15 04:30:04 +08:00
|
|
|
RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSO1.cpp -fPIC -shared -o %dynamiclib1 %ld_flags_rpath_so1
|
|
|
|
RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSO2.cpp -fPIC -shared -o %dynamiclib2 %ld_flags_rpath_so2
|
|
|
|
RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSOTestMain.cpp %S/DSOTestExtra.cpp %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t-DSOTest
|
2018-05-22 03:47:00 +08:00
|
|
|
|
|
|
|
RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/NullDerefTest.cpp -o %t-NullDerefTest
|
|
|
|
|
|
|
|
RUN: rm -rf %t_workdir && mkdir -p %t_workdir
|
2018-06-15 06:13:36 +08:00
|
|
|
RUN: env ASAN_OPTIONS=coverage_dir='"%t_workdir"' not %run %t-NullDerefTest -dump_coverage=1 2>&1 | FileCheck %s
|
2018-10-10 08:57:44 +08:00
|
|
|
RUN: sancov -covered-functions %t-NullDerefTest %t_workdir/*.sancov | FileCheck %s --check-prefix=SANCOV
|
2018-07-12 06:07:31 +08:00
|
|
|
RUN: env ASAN_OPTIONS=coverage_dir='"%t_workdir"' %run %t-DSOTest -dump_coverage=1 -runs=0 2>&1 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=DSO
|
2018-06-15 06:13:36 +08:00
|
|
|
RUN: env ASAN_OPTIONS=coverage_dir='"%t_workdir"' not %run %t-NullDerefTest -dump_coverage=0 2>&1 | FileCheck %s --check-prefix=NOCOV
|
2018-05-22 03:47:00 +08:00
|
|
|
|
|
|
|
CHECK: SanitizerCoverage: {{.*}}NullDerefTest.{{.*}}.sancov: {{.*}} PCs written
|
|
|
|
SANCOV: LLVMFuzzerTestOneInput
|
|
|
|
|
|
|
|
DSO: SanitizerCoverage: {{.*}}DSOTest.{{.*}}.sancov: {{.*}} PCs written
|
2018-06-15 04:30:04 +08:00
|
|
|
DSO-DAG: SanitizerCoverage: {{.*}}.{{.*}}.sancov: {{.*}} PCs written
|
|
|
|
DSO-DAG: SanitizerCoverage: {{.*}}2.{{.*}}.sancov: {{.*}} PCs written
|
2018-05-22 03:47:00 +08:00
|
|
|
|
|
|
|
NOCOV-NOT: SanitizerCoverage: {{.*}} PCs written
|