Skip to content

Commit c12f08f

Browse files
Reapply "[compiler-rt] Remove %T from shared object substitutions (llvm#155302)"
This reverts commit 05e3143. There was quite a bit of churn with this patch, everytime related to the executable no longer being in the same directory as the shared objects. This reland ensures that all of the executables in the tests touched are in the same directory as the shared objects in the substitutions.
1 parent 370e007 commit c12f08f

26 files changed

+179
-164
lines changed

compiler-rt/test/asan/TestCases/Linux/coverage-missing.cpp

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
// Test for "sancov.py missing ...".
22

33
// First case: coverage from executable. main() is called on every code path.
4-
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %t -DFOOBAR -DMAIN
5-
// RUN: rm -rf %t-dir
6-
// RUN: mkdir -p %t-dir
7-
// RUN: cd %t-dir
8-
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t-dir %run %t
4+
// RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir
5+
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %t.dir/exe -DFOOBAR -DMAIN
6+
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t.dir %run %t.dir/exe
97
// RUN: %sancov print *.sancov > main.txt
108
// RUN: rm *.sancov
119
// RUN: count 1 < main.txt
12-
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t-dir %run %t x
10+
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t.dir %run %t.dir/exe x
1311
// RUN: %sancov print *.sancov > foo.txt
1412
// RUN: rm *.sancov
1513
// RUN: count 3 < foo.txt
16-
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t-dir %run %t x x
14+
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t.dir %run %t.dir/exe x x
1715
// RUN: %sancov print *.sancov > bar.txt
1816
// RUN: rm *.sancov
1917
// RUN: count 4 < bar.txt
20-
// RUN: %sancov missing %t < foo.txt > foo-missing.txt
18+
// RUN: %sancov missing %t.dir/exe < foo.txt > foo-missing.txt
2119
// RUN: sort main.txt foo-missing.txt -o foo-missing-with-main.txt
2220
// The "missing from foo" set may contain a few bogus PCs from the sanitizer
2321
// runtime, but it must include the entire "bar" code path as a subset. Sorted
@@ -26,18 +24,15 @@
2624
// RUN: not grep "^<" %t.log
2725

2826
// Second case: coverage from DSO.
29-
// cd %t-dir
30-
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %dynamiclib -DFOOBAR -shared -fPIC
31-
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %dynamiclib -o %t -DMAIN
3227
// RUN: cd ..
33-
// RUN: rm -rf %t-dir
34-
// RUN: mkdir -p %t-dir
35-
// RUN: cd %t-dir
36-
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t-dir %run %t x
28+
// RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir
29+
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %dynamiclib -DFOOBAR -shared -fPIC
30+
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %dynamiclib -o %t.dir/exe -DMAIN
31+
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t.dir %run %t.dir/exe x
3732
// RUN: %sancov print %xdynamiclib_filename.*.sancov > foo.txt
3833
// RUN: rm *.sancov
3934
// RUN: count 2 < foo.txt
40-
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t-dir %run %t x x
35+
// RUN: %env_asan_opts=coverage=1:coverage_dir=%t.dir %run %t.dir/exe x x
4136
// RUN: %sancov print %xdynamiclib_filename.*.sancov > bar.txt
4237
// RUN: rm *.sancov
4338
// RUN: count 3 < bar.txt

compiler-rt/test/asan/TestCases/Linux/local_alias.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
// false positive global-buffer-overflow due to sanitized library poisons
55
// globals from non-sanitized one.
66
//
7+
// RUN: mkdir -p %t.dir && cd %t.dir
78
// RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %dynamiclib1
89
// RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %dynamiclib2
910
// RUN: %clangxx %s -c -mllvm -asan-use-private-alias -o %t.o
10-
// RUN: %clangxx_asan %t.o %ld_flags_rpath_exe2 %ld_flags_rpath_exe1 -o %t-EXE
11-
// RUN: %run %t-EXE
11+
// RUN: %clangxx_asan %t.o %ld_flags_rpath_exe2 %ld_flags_rpath_exe1 -o %t.dir/EXE
12+
// RUN: %run %t.dir/EXE
1213

1314
#if defined (BUILD_INSTRUMENTED_DSO)
1415
long h = 15;

compiler-rt/test/asan/TestCases/Linux/odr-violation.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,39 @@
1010
// -fno-sanitize-address-use-odr-indicator turns off both.
1111
//
1212
// Different size: detect a bug if detect_odr_violation>=1
13+
// RUN: mkdir -p %t.dir && cd %t.dir
1314
// RUN: %clangxx_asan -g -DBUILD_SO=1 -fPIC -shared -fno-sanitize-address-use-odr-indicator %s -o %dynamiclib
14-
// RUN: %clangxx_asan -g -fno-sanitize-address-use-odr-indicator %s %ld_flags_rpath_exe -o %t-ODR-EXE
15-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 not %run %t-ODR-EXE 2>&1 | FileCheck %s
16-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s
17-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
18-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s
15+
// RUN: %clangxx_asan -g -fno-sanitize-address-use-odr-indicator %s %ld_flags_rpath_exe -o %t.dir/ODR-EXE
16+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
17+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
18+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=0 %run %t.dir/ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
19+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
1920
//
2021
// Same size: report a bug only if detect_odr_violation>=2.
2122
// RUN: %clangxx_asan -g -DBUILD_SO=1 -fPIC -shared -fno-sanitize-address-use-odr-indicator %s -o %dynamiclib -DSZ=100
22-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
23-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s
24-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s
25-
// RUN: echo "odr_violation:foo::ZZZ" > %t.supp
26-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.supp not %run %t-ODR-EXE 2>&1 | FileCheck %s
27-
// RUN: echo "odr_violation:foo::G" > %t.supp
28-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.supp %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
29-
// RUN: rm -f %t.supp
23+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 %run %t.dir/ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
24+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
25+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
26+
// RUN: echo "odr_violation:foo::ZZZ" > %t.dir/supp
27+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.dir/supp not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
28+
// RUN: echo "odr_violation:foo::G" > %t.dir/supp
29+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.dir/supp %run %t.dir/ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
30+
// RUN: rm -f %t.dir/supp
3031
//
3132
// Use private aliases for global variables without indicator symbol.
3233
// RUN: %clangxx_asan -g -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-odr-indicator=0 %s -o %dynamiclib -DSZ=100
33-
// RUN: %clangxx_asan -g -mllvm -asan-use-odr-indicator=0 %s %ld_flags_rpath_exe -o %t-ODR-EXE
34-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
34+
// RUN: %clangxx_asan -g -mllvm -asan-use-odr-indicator=0 %s %ld_flags_rpath_exe -o %t.dir/ODR-EXE
35+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 %run %t.dir/ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
3536

3637
// Use private aliases for global variables: use indicator symbol to detect ODR violation.
3738
// RUN: %clangxx_asan -g -DBUILD_SO=1 -fPIC -shared %s -o %dynamiclib -DSZ=100
38-
// RUN: %clangxx_asan -g %s %ld_flags_rpath_exe -o %t-ODR-EXE
39-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s
39+
// RUN: %clangxx_asan -g %s %ld_flags_rpath_exe -o %t.dir/ODR-EXE
40+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
4041

4142
// Same as above but with clang switches.
4243
// RUN: %clangxx_asan -g -DBUILD_SO=1 -fPIC -shared -fsanitize-address-use-odr-indicator %s -o %dynamiclib -DSZ=100
43-
// RUN: %clangxx_asan -g -fsanitize-address-use-odr-indicator %s %ld_flags_rpath_exe -o %t-ODR-EXE
44-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s
44+
// RUN: %clangxx_asan -g -fsanitize-address-use-odr-indicator %s %ld_flags_rpath_exe -o %t.dir/ODR-EXE
45+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t.dir/ODR-EXE 2>&1 | FileCheck %s
4546

4647
// GNU driver doesn't handle .so files properly.
4748
// REQUIRES: Clang
@@ -58,7 +59,7 @@ namespace foo { char G[SZ]; }
5859
#include <stdio.h>
5960
namespace foo { char G[100]; }
6061
// CHECK: ERROR: AddressSanitizer: odr-violation
61-
// CHECK: size=100 'foo::G' {{.*}}odr-violation.cpp:[[@LINE-2]] in {{.*}}.tmp-ODR-EXE
62+
// CHECK: size=100 'foo::G' {{.*}}odr-violation.cpp:[[@LINE-2]] in {{.*}}/ODR-EXE
6263
// CHECK: size={{4|100}} 'foo::G'
6364
int main(int argc, char **argv) {
6465
printf("PASS: %p\n", &foo::G);

compiler-rt/test/asan/TestCases/Linux/odr-vtable.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
// REQUIRES: shared_cxxabi
55

66
/// Not using private alias or enabling ODR indicator can detect ODR issues.
7+
// RUN: mkdir -p %t.dir && cd %t.dir
78
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared -mllvm -asan-use-private-alias=0 %s -o %dynamiclib1
89
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared -mllvm -asan-use-private-alias=0 %s -o %dynamiclib2
9-
// RUN: %clangxx_asan -fno-rtti %s %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
10-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
10+
// RUN: %clangxx_asan -fno-rtti %s %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t.dir/EXE
11+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t.dir/EXE 2>&1 | FileCheck %s
1112

1213
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared -mllvm -asan-use-odr-indicator=1 %s -o %dynamiclib1
1314
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared -mllvm -asan-use-odr-indicator=1 %s -o %dynamiclib2
14-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
15+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t.dir/EXE 2>&1 | FileCheck %s
1516

1617
/// By default we can detect ODR issues in vtables.
1718
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared %s -o %dynamiclib1
1819
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared %s -o %dynamiclib2
19-
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
20+
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t.dir/EXE 2>&1 | FileCheck %s
2021

2122
struct XYZ {
2223
virtual void foo();

compiler-rt/test/asan/TestCases/Linux/odr_c_test.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// Test that we can properly report an ODR violation between an instrumented
22
// global and a non-instrumented global if not using private aliases.
33

4+
// RUN: mkdir -p %t.dir && cd %t.dir
45
// RUN: %clang_asan -fcommon %s -fPIC -shared -mllvm -asan-use-private-alias=0 -o %dynamiclib1 -DFILE1
56
// RUN: %clang_asan -fcommon %s -fPIC -shared -mllvm -asan-use-private-alias=0 -o %dynamiclib2 -DFILE2
6-
// RUN: %clang_asan -fcommon %s -fPIE %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
7-
// RUN: not %run %t 2>&1 | FileCheck %s
7+
// RUN: %clang_asan -fcommon %s -fPIE %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t.dir/exe
8+
// RUN: not %run %t.dir/exe 2>&1 | FileCheck %s
89

910
// RUN: %clang_asan -fcommon %s -fPIC -shared -mllvm -asan-use-private-alias=1 -o %dynamiclib1 -DFILE1
1011
// RUN: %clang_asan -fcommon %s -fPIC -shared -mllvm -asan-use-private-alias=1 -o %dynamiclib2 -DFILE2
11-
// RUN: %run %t 2>&1 | count 0
12+
// RUN: %run %t.dir/exe 2>&1 | count 0
1213

1314
// Unaligned accesses don't work on strict-alignment targets like SPARC.
1415
// UNSUPPORTED: sparc-target-arch

compiler-rt/test/asan/TestCases/Linux/preinit_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
// RUN: mkdir -p %t.dir && cd %t.dir
12
// RUN: %clangxx -DFUNC=zzzz %s -shared -o %dynamiclib -fPIC
2-
// RUN: %clangxx_asan -DFUNC=main %s -o %t %ld_flags_rpath_exe
3-
// RUN: %run %t
3+
// RUN: %clangxx_asan -DFUNC=main %s -o %t.dir/EXE %ld_flags_rpath_exe
4+
// RUN: %run %t.dir/EXE
45

56
// GNU driver doesn't handle .so files properly.
67
// REQUIRES: Clang

compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Check that unloading a module doesn't break coverage dumping for remaining
22
// modules.
3+
// RUN: mkdir -p %t.dir && cd %t.dir
34
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard -DSHARED %s -shared -o %dynamiclib1 -fPIC
45
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard -DSHARED %s -shared -o %dynamiclib2 -fPIC
5-
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %libdl -o %t.exe
6+
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %libdl -o %t.dir/exe
67
// RUN: mkdir -p %t.tmp/coverage-module-unloaded && cd %t.tmp/coverage-module-unloaded
7-
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.exe %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s
8-
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.exe %dynamiclib1 %dynamiclib2 foo 2>&1 | FileCheck %s
8+
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.dir/exe %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s
9+
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.dir/exe %dynamiclib1 %dynamiclib2 foo 2>&1 | FileCheck %s
910
//
1011
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
1112
// XFAIL: android

compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
// RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir
12
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so
2-
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %ld_flags_rpath_exe -o %t
3-
// RUN: rm -rf %t-dir && mkdir -p %t-dir && cd %t-dir
4-
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s
3+
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %ld_flags_rpath_exe -o %t.dir/EXE
4+
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.dir/EXE 2>&1 | tee /tmp/test
55
//
66
// UNSUPPORTED: ios
77

compiler-rt/test/asan/TestCases/Posix/coverage.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1+
// RUN:rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir
12
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so
2-
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %ld_flags_rpath_exe -o %t
3-
// RUN: rm -rf %t-dir && mkdir -p %t-dir && cd %t-dir
4-
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main
5-
// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1
6-
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-foo
7-
// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2
8-
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t bar 2>&1 | FileCheck %s --check-prefix=CHECK-bar
9-
// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2
10-
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t foo bar 2>&1 | FileCheck %s --check-prefix=CHECK-foo-bar
11-
// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2
3+
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %ld_flags_rpath_exe -o %t.dir/exe
4+
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.dir/exe 2>&1 | FileCheck %s --check-prefix=CHECK-main
5+
// RUN: %sancov print exe.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1
6+
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.dir/exe foo 2>&1 | FileCheck %s --check-prefix=CHECK-foo
7+
// RUN: %sancov print exe.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2
8+
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.dir/exe bar 2>&1 | FileCheck %s --check-prefix=CHECK-bar
9+
// RUN: %sancov print exe.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2
10+
// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.dir/exe foo bar 2>&1 | FileCheck %s --check-prefix=CHECK-foo-bar
11+
// RUN: %sancov print exe.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2
1212
// RUN: %sancov print libcoverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1
13-
// RUN: %sancov merge coverage.*sancov > merged-cov
13+
// RUN: %sancov merge exe.*sancov > merged-cov
1414
// RUN: %sancov print merged-cov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2
15-
// RUN: %env_asan_opts=coverage=1:verbosity=1 not %run %t foo bar 4 2>&1 | FileCheck %s --check-prefix=CHECK-report
16-
// RUN: %env_asan_opts=coverage=1:verbosity=1 not %run %t foo bar 4 5 2>&1 | FileCheck %s --check-prefix=CHECK-segv
17-
// RUN: cd .. && rm -rf %t-dir
15+
// RUN: %env_asan_opts=coverage=1:verbosity=1 not %run %t.dir/exe foo bar 4 2>&1 | FileCheck %s --check-prefix=CHECK-report
16+
// RUN: %env_asan_opts=coverage=1:verbosity=1 not %run %t.dir/exe foo bar 4 5 2>&1 | FileCheck %s --check-prefix=CHECK-segv
1817
//
1918
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
2019
// XFAIL: android

compiler-rt/test/asan/TestCases/Posix/interception-in-shared-lib-test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Check that memset() call from a shared library gets intercepted.
2-
2+
// RUN: mkdir -p %t.dir && cd %t.dir
33
// RUN: %clangxx_asan -O0 %s -DSHARED_LIB \
44
// RUN: -shared -o %dynamiclib -fPIC %ld_flags_rpath_so
5-
// RUN: %clangxx_asan -O0 %s -o %t %ld_flags_rpath_exe && \
6-
// RUN: not %run %t 2>&1 | FileCheck %s
5+
// RUN: %clangxx_asan -O0 %s -o %t.dir/EXE %ld_flags_rpath_exe && \
6+
// RUN: not %run %t.dir/EXE 2>&1 | FileCheck %s
77

88
#include <stdio.h>
99
#include <string.h>

0 commit comments

Comments
 (0)