diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc index 1c099d8622d0..0a5cf987c54b 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc @@ -15,6 +15,7 @@ #include "sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX +#include "sanitizer_atomic.h" #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_freebsd.h" @@ -22,8 +23,6 @@ #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" -#include "sanitizer_atomic.h" -#include "sanitizer_symbolizer.h" #if SANITIZER_ANDROID || SANITIZER_FREEBSD #include // for dlsym() @@ -462,19 +461,6 @@ uptr GetListOfModules(LoadedModule *modules, uptr max_modules, } #endif // SANITIZER_ANDROID -void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) { - // Some kinds of sandboxes may forbid filesystem access, so we won't be able - // to read the file mappings from /proc/self/maps. Luckily, neither the - // process will be able to load additional libraries, so it's fine to use the - // cached mappings. - MemoryMappingLayout::CacheMemoryMappings(); - // Same for /proc/self/exe in the symbolizer. -#if !SANITIZER_GO - Symbolizer::GetOrInit()->PrepareForSandboxing(); - CovPrepareForSandboxing(args); -#endif -} - // getrusage does not give us the current RSS, only the max RSS. // Still, this is better than nothing if /proc/self/statm is not available // for some reason, e.g. due to a sandbox. diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc index 91a5b7d9374f..05eb0be70354 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc @@ -220,11 +220,6 @@ void ReExec() { UNIMPLEMENTED(); } -void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) { - (void)args; - // Nothing here for now. -} - uptr GetPageSize() { return sysconf(_SC_PAGESIZE); } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc index 11828e6cdf51..2e7f91c6257b 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc @@ -18,7 +18,9 @@ #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_platform_limits_posix.h" +#include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" +#include "sanitizer_symbolizer.h" #include #include @@ -200,6 +202,19 @@ bool IsAccessibleMemoryRange(uptr beg, uptr size) { return result; } +void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) { + // Some kinds of sandboxes may forbid filesystem access, so we won't be able + // to read the file mappings from /proc/self/maps. Luckily, neither the + // process will be able to load additional libraries, so it's fine to use the + // cached mappings. + MemoryMappingLayout::CacheMemoryMappings(); + // Same for /proc/self/exe in the symbolizer. +#if !SANITIZER_GO + Symbolizer::GetOrInit()->PrepareForSandboxing(); + CovPrepareForSandboxing(args); +#endif +} + } // namespace __sanitizer #endif // SANITIZER_POSIX diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-direct-activation.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc similarity index 87% rename from compiler-rt/test/asan/TestCases/Linux/coverage-direct-activation.cc rename to compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc index 9b2a0d8897c8..05dc557136a5 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage-direct-activation.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc @@ -1,18 +1,18 @@ // Test for direct coverage writing enabled at activation time. -// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %T/libcoverage_direct_activation_test_1.so -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx -c -DSO_DIR=\"%T\" %s -o %t.o // RUN: %clangxx_asan -fsanitize-coverage=1 %t.o %libdl -o %t // RUN: rm -rf %T/coverage-direct-activation // RUN: mkdir -p %T/coverage-direct-activation/normal -// RUN: ASAN_OPTIONS=coverage=1,coverage_direct=0,coverage_dir=%T/coverage-direct-activation/normal:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1,coverage_direct=0,coverage_dir=%T/coverage-direct-activation/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct-activation/normal/*.sancov >%T/coverage-direct-activation/normal/out.txt // RUN: mkdir -p %T/coverage-direct-activation/direct // RUN: ASAN_OPTIONS=start_deactivated=1,coverage_direct=1,verbosity=1 \ -// RUN: ASAN_ACTIVATION_OPTIONS=coverage=1,coverage_dir=%T/coverage-direct-activation/direct %run %t +// RUN: ASAN_ACTIVATION_OPTIONS=coverage=1,coverage_dir=%T/coverage-direct-activation/direct %run %t %dynamiclib // RUN: cd %T/coverage-direct-activation/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt @@ -24,7 +24,7 @@ // RUN: mkdir -p %T/coverage-direct-activation/direct2 // RUN: ASAN_OPTIONS=start_deactivated=1,coverage=1,coverage_direct=1,verbosity=1 \ -// RUN: ASAN_ACTIVATION_OPTIONS=coverage_dir=%T/coverage-direct-activation/direct2 %run %t +// RUN: ASAN_ACTIVATION_OPTIONS=coverage_dir=%T/coverage-direct-activation/direct2 %run %t %dynamiclib // RUN: cd %T/coverage-direct-activation/direct2 // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt @@ -47,8 +47,8 @@ void bar() { printf("bar\n"); } int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); - void *handle1 = - dlopen(SO_DIR "/libcoverage_direct_activation_test_1.so", RTLD_LAZY); + assert(argc > 1); + void *handle1 = dlopen(argv[1], RTLD_LAZY); // %dynamiclib assert(handle1); void (*bar1)() = (void (*)())dlsym(handle1, "bar"); assert(bar1); diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-direct-large.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc similarity index 88% rename from compiler-rt/test/asan/TestCases/Linux/coverage-direct-large.cc rename to compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc index 25c950e0bb30..cf7351ddcd37 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage-direct-large.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc @@ -2,18 +2,18 @@ // Current implementation maps output file in chunks of 64K. This test overflows // 1 chunk. -// RUN: %clangxx_asan -fsanitize-coverage=1 -O0 -DSHARED %s -shared -o %T/libcoverage_direct_large_test_1.so -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=1 -O0 -DSO_DIR=\"%T\" %s %libdl -o %t +// RUN: %clangxx_asan -fsanitize-coverage=1 -O0 -DSHARED %s -shared -o %dynamiclib -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=1 -O0 %s %libdl -o %t // RUN: rm -rf %T/coverage-direct-large // RUN: mkdir -p %T/coverage-direct-large/normal && cd %T/coverage-direct-large/normal -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:verbosity=1 %run %t %dynamiclib // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // RUN: mkdir -p %T/coverage-direct-large/direct && cd %T/coverage-direct-large/direct -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:verbosity=1 %run %t %dynamiclib // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. @@ -49,11 +49,11 @@ extern "C" void so_entry() { #include #include -int main(void) { +#include +int main(int argc, char **argv) { F4(CALL, f) - - void *handle1 = - dlopen(SO_DIR "/libcoverage_direct_large_test_1.so", RTLD_LAZY); + assert(argc > 1); + void *handle1 = dlopen(argv[1], RTLD_LAZY); // %dynamiclib assert(handle1); void (*so_entry)() = (void (*)())dlsym(handle1, "so_entry"); assert(so_entry); diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc index 45222fa1a03e..60acbb74b167 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc @@ -1,16 +1,16 @@ // Test for direct coverage writing with dlopen at coverage level 1 to 3. -// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %T/libcoverage_direct_test_1.so -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=1 -DSO_DIR=\"%T\" %s %libdl -o %t +// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=1 %s %libdl -o %t // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct/normal/*.sancov >%T/coverage-direct/normal/out.txt // RUN: mkdir -p %T/coverage-direct/direct -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib // RUN: cd %T/coverage-direct/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt @@ -19,17 +19,17 @@ // RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt -// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED %s -shared -o %T/libcoverage_direct_test_1.so -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=2 -DSO_DIR=\"%T\" %s %libdl -o %t // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct/normal/*.sancov >%T/coverage-direct/normal/out.txt // RUN: mkdir -p %T/coverage-direct/direct -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib // RUN: cd %T/coverage-direct/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt @@ -38,17 +38,17 @@ // RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt -// RUN: %clangxx_asan -fsanitize-coverage=3 -DSHARED %s -shared -o %T/libcoverage_direct_test_1.so -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=3 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=3 -DSO_DIR=\"%T\" %s %libdl -o %t // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct/normal/*.sancov >%T/coverage-direct/normal/out.txt // RUN: mkdir -p %T/coverage-direct/direct -// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t +// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib // RUN: cd %T/coverage-direct/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt @@ -71,8 +71,8 @@ void bar() { printf("bar\n"); } int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); - void *handle1 = - dlopen(SO_DIR "/libcoverage_direct_test_1.so", RTLD_LAZY); + assert(argc > 1); + void *handle1 = dlopen(argv[1], RTLD_LAZY); assert(handle1); void (*bar1)() = (void (*)())dlsym(handle1, "bar"); assert(bar1); diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-fork-direct.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc similarity index 100% rename from compiler-rt/test/asan/TestCases/Linux/coverage-fork-direct.cc rename to compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-module-unloaded.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc similarity index 67% rename from compiler-rt/test/asan/TestCases/Linux/coverage-module-unloaded.cc rename to compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc index 573fc4664818..26ef479626ec 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage-module-unloaded.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc @@ -1,13 +1,13 @@ // Check that unloading a module doesn't break coverage dumping for remaining // modules. -// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %T/libcoverage_module_unloaded_test_1.so -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %T/libcoverage_module_unloaded_test_2.so -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=1 -DSO_DIR=\"%T\" %s %libdl -o %t +// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib1 -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib2 -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=1 %s %libdl -o %t // RUN: export ASAN_OPTIONS=coverage=1:verbosity=1 // RUN: mkdir -p %T/coverage-module-unloaded && cd %T/coverage-module-unloaded -// RUN: %run %t 2>&1 | FileCheck %s -// RUN: %run %t foo 2>&1 | FileCheck %s -// RUN: cd .. && rm coverage-module-unloaded -r +// RUN: %run %t %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s +// RUN: %run %t %dynamiclib1 %dynamiclib2 foo 2>&1 | FileCheck %s +// RUN: rm -r %T/coverage-module-unloaded // // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android @@ -25,14 +25,13 @@ void bar() { printf("bar\n"); } int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); - void *handle1 = - dlopen(SO_DIR "/libcoverage_module_unloaded_test_1.so", RTLD_LAZY); + assert(argc > 2); + void *handle1 = dlopen(argv[1], RTLD_LAZY); // %dynamiclib1 assert(handle1); void (*bar1)() = (void (*)())dlsym(handle1, "bar"); assert(bar1); bar1(); - void *handle2 = - dlopen(SO_DIR "/libcoverage_module_unloaded_test_2.so", RTLD_LAZY); + void *handle2 = dlopen(argv[2], RTLD_LAZY); // %dynamiclib2 assert(handle2); void (*bar2)() = (void (*)())dlsym(handle2, "bar"); assert(bar2); @@ -50,7 +49,7 @@ int main(int argc, char **argv) { // CHECK: PID: [[PID:[0-9]+]] // CHECK: [[PID]].sancov: 1 PCs written -// CHECK: test_1.so.[[PID]] -// CHECK: test_2.so.[[PID]] +// CHECK: coverage-module-unloaded{{.*}}1.[[PID]] +// CHECK: coverage-module-unloaded{{.*}}2.[[PID]] // Even though we've unloaded one of the libs we still dump the coverage file -// for that lib (although the data will be inaccurate, it at all useful) +// for that lib (although the data will be inaccurate, if at all useful) diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-sandboxing.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc similarity index 84% rename from compiler-rt/test/asan/TestCases/Linux/coverage-sandboxing.cc rename to compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc index 15bada8865bf..8f1c1ee88838 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage-sandboxing.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc @@ -1,5 +1,5 @@ -// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED %s -shared -o %T/libcoverage_sandboxing_test.so -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t -Wl,-R,\$ORIGIN -L%T -lcoverage_sandboxing_test +// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so +// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t %ld_flags_rpath_exe // RUN: export ASAN_OPTIONS=coverage=1:verbosity=1 // RUN: rm -rf %T/coverage_sandboxing_test // RUN: mkdir %T/coverage_sandboxing_test && cd %T/coverage_sandboxing_test @@ -12,12 +12,12 @@ // RUN: %run %t a b 2>&1 | FileCheck %s --check-prefix=CHECK-sandbox // RUN: %sancov unpack coverage_sandboxing_test.sancov.packed // RUN: cd .. -// RUN: %sancov print vanilla/libcoverage_sandboxing_test.so.*.sancov > vanilla.txt -// RUN: %sancov print sandbox1/libcoverage_sandboxing_test.so.*.sancov > sandbox1.txt -// RUN: %sancov print sandbox2/libcoverage_sandboxing_test.so.*.sancov > sandbox2.txt +// RUN: %sancov print vanilla/`basename %dynamiclib`*.sancov > vanilla.txt +// RUN: %sancov print sandbox1/`basename %dynamiclib`*.sancov > sandbox1.txt +// RUN: %sancov print sandbox2/`basename %dynamiclib`*.sancov > sandbox2.txt // RUN: diff vanilla.txt sandbox1.txt // RUN: diff vanilla.txt sandbox2.txt -// RUN: cd ../ && rm coverage_sandboxing_test -r +// RUN: rm -r %T/coverage_sandboxing_test // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage.cc b/compiler-rt/test/asan/TestCases/Posix/coverage.cc similarity index 75% rename from compiler-rt/test/asan/TestCases/Linux/coverage.cc rename to compiler-rt/test/asan/TestCases/Posix/coverage.cc index 1ad19e66c5b3..7b590157a1e4 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage.cc @@ -1,21 +1,21 @@ -// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %T/libcoverage_test.so -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t -Wl,-R,\$ORIGIN -L%T -lcoverage_test +// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so +// RUN: %clangxx_asan -fsanitize-coverage=1 %s %ld_flags_rpath_exe -o %t // RUN: export ASAN_OPTIONS=coverage=1:verbosity=1 // RUN: rm -rf %T/coverage && mkdir -p %T/coverage && cd %T/coverage // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main -// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1 +// RUN: %sancov print `ls coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1 // RUN: %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-foo -// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 +// RUN: %sancov print `ls coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 // RUN: %run %t bar 2>&1 | FileCheck %s --check-prefix=CHECK-bar -// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 +// RUN: %sancov print `ls *coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 // RUN: %run %t foo bar 2>&1 | FileCheck %s --check-prefix=CHECK-foo-bar -// RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 -// RUN: %sancov print libcoverage_test.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1 -// RUN: %sancov merge coverage.*sancov > merged-cov +// RUN: %sancov print `ls *coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 +// RUN: %sancov print `ls *coverage.*sancov | grep '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1 +// RUN: %sancov merge `ls *coverage.*sancov | grep -v '.so'` > merged-cov // RUN: %sancov print merged-cov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 // RUN: not %run %t foo bar 4 2>&1 | FileCheck %s --check-prefix=CHECK-report // RUN: not %run %t foo bar 4 5 2>&1 | FileCheck %s --check-prefix=CHECK-segv -// RUN: cd .. && rm coverage -r +// RUN: rm -r %T/coverage // // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android