diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp index 2fbace52696a9e..6fdd23b84432f9 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp @@ -7,10 +7,9 @@ // XFAIL: ubsan,tsan // XFAIL: android && asan -// RUN: DIR=%t_workdir -// RUN: rm -rf $DIR -// RUN: mkdir -p $DIR -// RUN: cd $DIR +// RUN: rm -rf %t_workdir +// RUN: mkdir -p %t_workdir +// RUN: cd %t_workdir // RUN: echo -e "src:*\nfun:*" > al_all.txt // RUN: echo -e "" > al_none.txt @@ -82,7 +81,7 @@ // RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table -fsanitize-coverage-allowlist=al_bar.txt -fsanitize-coverage-ignorelist=bl_bar.txt 2>&1 | not grep -f patterns.txt // RUN: cd - -// RUN: rm -rf $DIR +// RUN: rm -rf %t_workdir // foo has 3 instrumentation points, 0 indirect call, 1 comparison point diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp index b168954a1c92cf..ba59e28f688a71 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp @@ -3,15 +3,14 @@ // REQUIRES: x86_64-linux // XFAIL: tsan // -// RUN: DIR=%t_workdir -// RUN: rm -rf $DIR -// RUN: mkdir -p $DIR -// RUN: cd $DIR +// RUN: rm -rf %t_workdir +// RUN: mkdir -p %t_workdir +// RUN: cd %t_workdir /// In glibc 2.39+, fprintf has a nonnull attribute. Disable nonnull-attribute, /// which would increase counters for ubsan. // RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard -fno-sanitize=nonnull-attribute %s -o %t // RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s -// RUN: rm -rf $DIR +// RUN: rm -rf %t_workdir #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp index e27d552f3c3184..9a27bc89a5fae1 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp @@ -5,19 +5,17 @@ // XFAIL: tsan,darwin // XFAIL: android && asan -// RUN: DIR=%t_workdir -// RUN: CLANG_ARGS="-O0 -fsanitize-coverage=trace-pc-guard" -// RUN: rm -rf $DIR -// RUN: mkdir -p $DIR -// RUN: cd $DIR -// RUN: %clangxx -DSHARED1 $CLANG_ARGS -shared %s -o %t_1.so -fPIC -// RUN: %clangxx -DSHARED2 $CLANG_ARGS -shared %s -o %t_2.so -fPIC -// RUN: %clangxx -DMAIN $CLANG_ARGS %s -o %t %t_1.so %t_2.so +// RUN: rm -rf %t_workdir +// RUN: mkdir -p %t_workdir +// RUN: cd %t_workdir +// RUN: %clangxx -DSHARED1 -O0 -fsanitize-coverage=trace-pc-guard -shared %s -o %t_1.so -fPIC +// RUN: %clangxx -DSHARED2 -O0 -fsanitize-coverage=trace-pc-guard -shared %s -o %t_2.so -fPIC +// RUN: %clangxx -DMAIN -O0 -fsanitize-coverage=trace-pc-guard %s -o %t %t_1.so %t_2.so // RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s // RUN: %sancovcc -covered-functions -strip_path_prefix=TestCases/ *.sancov \ // RUN: %t %t_1.so %t_2.so 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-SANCOV %s -// RUN: rm -rf $DIR +// RUN: rm -rf %t_workdir #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp index 0b2da9aebac8e2..cd5ea30713a578 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp @@ -2,16 +2,14 @@ // // REQUIRES: has_sancovcc,stable-runtime,x86_64-linux // -// RUN: DIR=%t_workdir -// RUN: CLANG_ARGS="-O0 -fsanitize-coverage=trace-pc-guard" -// RUN: rm -rf $DIR -// RUN: mkdir -p $DIR -// RUN: cd $DIR -// RUN: %clangxx -DSHARED1 $CLANG_ARGS -shared %s -o %t_1.so -fPIC -// RUN: %clangxx -DSTATIC1 $CLANG_ARGS %s -c -o %t_2.o -// RUN: %clangxx -DMAIN $CLANG_ARGS %s -o %t %t_1.so %t_2.o +// RUN: rm -rf %t_workdir +// RUN: mkdir -p %t_workdir +// RUN: cd %t_workdir +// RUN: %clangxx -DSHARED1 -O0 -fsanitize-coverage=trace-pc-guard -shared %s -o %t_1.so -fPIC +// RUN: %clangxx -DSTATIC1 -O0 -fsanitize-coverage=trace-pc-guard %s -c -o %t_2.o +// RUN: %clangxx -DMAIN -O0 -fsanitize-coverage=trace-pc-guard %s -o %t %t_1.so %t_2.o // RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s -// RUN: rm -rf $DIR +// RUN: rm -rf %t_workdir #include #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp index eea92d0ba9e838..b4b491455c390a 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp @@ -7,16 +7,15 @@ // XFAIL: tsan // XFAIL: android && asan -// RUN: DIR=%t_workdir -// RUN: rm -rf $DIR -// RUN: mkdir -p $DIR -// RUN: cd $DIR +// RUN: rm -rf %t_workdir +// RUN: mkdir -p %t_workdir +// RUN: cd %t_workdir // RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard %s -o %t // RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s // RUN: %sancovcc -covered-functions -strip_path_prefix=TestCases/ *.sancov %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-SANCOV %s // RUN: %env_tool_opts=coverage=0 %t 2>&1 | FileCheck --check-prefix=CHECK-NOCOV %s -// RUN: rm -rf $DIR +// RUN: rm -rf %t_workdir // Make some room to stabilize line numbers #include