diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-25 18:27:53 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-25 18:27:53 +0000 |
| commit | 1130681716753d2c217a31c86ef9b99286036675 (patch) | |
| tree | 4e08b7c0fc9019e1bb439dc7a935052882a6285d | |
| parent | 2441aecd1e00d03d1b43363ea1a98c3aac00f5cf (diff) | |
| download | bcm5719-llvm-1130681716753d2c217a31c86ef9b99286036675.tar.gz bcm5719-llvm-1130681716753d2c217a31c86ef9b99286036675.zip | |
[ASan] More ASAN_OPTIONS churn: use %env_asan_opts where applicable.
Reviewers: filcab, rnk, kubabrecka
Subscribers: tberghammer, danalbert, srhines, llvm-commits
Differential Revision: http://reviews.llvm.org/D12305
llvm-svn: 245962
55 files changed, 142 insertions, 148 deletions
diff --git a/compiler-rt/test/asan/TestCases/Android/coverage-android.cc b/compiler-rt/test/asan/TestCases/Android/coverage-android.cc index 5f263160559..16a6e1f7e16 100644 --- a/compiler-rt/test/asan/TestCases/Android/coverage-android.cc +++ b/compiler-rt/test/asan/TestCases/Android/coverage-android.cc @@ -9,7 +9,7 @@ // RUN: adb shell mkdir -p %device/coverage-android/direct // RUN: mkdir -p %T/coverage-android/direct -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t +// RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t // RUN: adb pull %device/coverage-android/direct %T/coverage-android/direct // RUN: ls; pwd // RUN: cd %T/coverage-android/direct @@ -26,7 +26,7 @@ // RUN: adb shell mkdir -p %device/coverage-android-kill/direct // RUN: mkdir -p %T/coverage-android-kill/direct -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t +// RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t // RUN: adb pull %device/coverage-android-kill/direct %T/coverage-android-kill/direct // RUN: ls; pwd // RUN: cd %T/coverage-android-kill/direct @@ -43,7 +43,7 @@ // RUN: adb shell mkdir -p %device/coverage-android/direct // RUN: mkdir -p %T/coverage-android/direct -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t +// RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t // RUN: adb pull %device/coverage-android/direct %T/coverage-android/direct // RUN: ls; pwd // RUN: cd %T/coverage-android/direct @@ -60,7 +60,7 @@ // RUN: adb shell mkdir -p %device/coverage-android-kill/direct // RUN: mkdir -p %T/coverage-android-kill/direct -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t +// RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t // RUN: adb pull %device/coverage-android-kill/direct %T/coverage-android-kill/direct // RUN: ls; pwd // RUN: cd %T/coverage-android-kill/direct @@ -77,7 +77,7 @@ // RUN: adb shell mkdir -p %device/coverage-android/direct // RUN: mkdir -p %T/coverage-android/direct -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t +// RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t // RUN: adb pull %device/coverage-android/direct %T/coverage-android/direct // RUN: ls; pwd // RUN: cd %T/coverage-android/direct @@ -94,7 +94,7 @@ // RUN: adb shell mkdir -p %device/coverage-android-kill/direct // RUN: mkdir -p %T/coverage-android-kill/direct -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t +// RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t // RUN: adb pull %device/coverage-android-kill/direct %T/coverage-android-kill/direct // RUN: ls; pwd // RUN: cd %T/coverage-android-kill/direct diff --git a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc index f6070188d8e..aa881ae134e 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc +++ b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc @@ -1,5 +1,5 @@ // Check that when having a DYLD_ROOT_PATH set, the symbolizer still works. -// RUN: env DYLD_ROOT_PATH="/" ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) \ +// RUN: %env_asan_opts=verbosity=2 DYLD_ROOT_PATH="/" ASAN_SYMBOLIZER_PATH=$(which atos) \ // RUN: not %run %t 2>&1 | FileCheck %s // // Due to a bug in atos, this only works on x86_64. diff --git a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cc b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cc index 03cadf92d16..2a9ffbc5b25 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cc +++ b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cc @@ -1,7 +1,7 @@ // Check that the `atos` symbolizer works. -// RUN: %clangxx_asan -O0 %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -o %t +// RUN: %env_asan_opts=verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) not %run %t 2>&1 | FileCheck %s #include <stdlib.h> #include <string.h> diff --git a/compiler-rt/test/asan/TestCases/Darwin/dladdr-demangling.cc b/compiler-rt/test/asan/TestCases/Darwin/dladdr-demangling.cc index 3d36c4f9635..d773659b74f 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/dladdr-demangling.cc +++ b/compiler-rt/test/asan/TestCases/Darwin/dladdr-demangling.cc @@ -1,9 +1,9 @@ // In a non-forking sandbox, we fallback to dladdr(). Test that we provide // properly demangled C++ names in that case. -// RUN: %clangxx_asan -O0 %s -o %t +// RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-DLADDR +// RUN: %env_asan_opts=verbosity=2 not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-DLADDR #include <stdlib.h> diff --git a/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc b/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc index 486223473d4..7e8d9173d29 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc +++ b/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc @@ -8,22 +8,23 @@ // RUN: %T/dyld_insert_libraries_reexec/libclang_rt.asan_osx_dynamic.dylib // RUN: %clangxx_asan %s -o %T/dyld_insert_libraries_reexec/a.out -// RUN: env DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib \ -// RUN: ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ +// RUN: %env_asan_opts=verbosity=1 \ +// RUN: DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib \ +// RUN: %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ // RUN: | FileCheck %s // RUN: IS_OSX_10_11_OR_HIGHER=$([ `sw_vers -productVersion | cut -d'.' -f2` -lt 11 ]; echo $?) // On OS X 10.10 and lower, if the dylib is not DYLD-inserted, ASan will re-exec. // RUN: if [ $IS_OSX_10_11_OR_HIGHER == 0 ]; then \ -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ +// RUN: %env_asan_opts=verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NOINSERT %s; \ // RUN: fi // On OS X 10.11 and higher, we don't need to DYLD-insert anymore, and the interceptors // still installed correctly. Let's just check that things work and we don't try to re-exec. // RUN: if [ $IS_OSX_10_11_OR_HIGHER == 1 ]; then \ -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ +// RUN: %env_asan_opts=verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ // RUN: | FileCheck %s; \ // RUN: fi diff --git a/compiler-rt/test/asan/TestCases/Darwin/suppressions-darwin.cc b/compiler-rt/test/asan/TestCases/Darwin/suppressions-darwin.cc index 488bff14022..403d819706a 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/suppressions-darwin.cc +++ b/compiler-rt/test/asan/TestCases/Darwin/suppressions-darwin.cc @@ -4,17 +4,17 @@ // Check that suppressing the interceptor by name works. // RUN: echo "interceptor_name:memmove" > %t.supp -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s +// RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // Check that suppressing by interceptor name works even without the symbolizer -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp':symbolize=false" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s +// RUN: %env_asan_opts=suppressions='"%t.supp"':symbolize=false %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // Check that suppressing all reports from a library works. // RUN: echo "interceptor_via_lib:CoreFoundation" > %t.supp -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s +// RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // Check that suppressing library works even without the symbolizer. -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp':symbolize=false" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s +// RUN: %env_asan_opts=suppressions='"%t.supp"':symbolize=false %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s #include <CoreFoundation/CoreFoundation.h> diff --git a/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cc b/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cc index 47d80f80db2..ddbad466f7b 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cc +++ b/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cc @@ -4,7 +4,7 @@ // Check that suppressing a function name works within a no-fork sandbox // RUN: echo "interceptor_via_fun:CFStringCreateWithBytes" > %t.supp -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:suppressions=%t.supp \ +// RUN: %env_asan_opts=suppressions='"%t.supp"' \ // RUN: sandbox-exec -p '(version 1)(allow default)(deny process-fork)' \ // RUN: %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s diff --git a/compiler-rt/test/asan/TestCases/Linux/activation-options.cc b/compiler-rt/test/asan/TestCases/Linux/activation-options.cc index 774c7bdfc92..1a1ad3f8c49 100644 --- a/compiler-rt/test/asan/TestCases/Linux/activation-options.cc +++ b/compiler-rt/test/asan/TestCases/Linux/activation-options.cc @@ -10,21 +10,21 @@ // RUN: rm -f %t.asan.options.ABCDE // RUN: echo "help=1" >%t.asan.options.activation-options.cc.tmp -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \ +// RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-HELP --check-prefix=CHECK-FOUND -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \ +// RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-NO-HELP --check-prefix=CHECK-MISSING -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \ +// RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b not %run %t --fix-name 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-NO-HELP --check-prefix=CHECK-MISSING // RUN: echo "help=1" >%t.asan.options.ABCDE -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \ +// RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b %run %t --fix-name 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-HELP --check-prefix=CHECK-FOUND diff --git a/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc b/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc index 9e58f83d40c..d67d945851f 100644 --- a/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc @@ -7,7 +7,7 @@ // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -Wl,-Ttext-segment=0x3600000000 ||\ // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -Wl,-Ttext=0x3600000000 // RUN: %clangxx_asan %t.o %t.so -Wl,-R. -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s // GNU driver doesn't handle .so files properly. // REQUIRES: x86_64-supported-target, asan-64-bits, Clang diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc b/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc index 36f33b505e2..6cd3201c48d 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc +++ b/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc @@ -1,21 +1,19 @@ // Test for "sancov.py missing ...". -// RUN: export ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_dir=%T/coverage-missing - // First case: coverage from executable. main() is called on every code path. // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -DFOOBAR -DMAIN // RUN: rm -rf %T/coverage-missing // RUN: mkdir -p %T/coverage-missing // RUN: cd %T/coverage-missing -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t +// RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t // RUN: %sancov print *.sancov > main.txt // RUN: rm *.sancov // RUN: [ $(cat main.txt | wc -l) == 1 ] -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x +// RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x // RUN: %sancov print *.sancov > foo.txt // RUN: rm *.sancov // RUN: [ $(cat foo.txt | wc -l) == 3 ] -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x x +// RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x x // RUN: %sancov print *.sancov > bar.txt // RUN: rm *.sancov // RUN: [ $(cat bar.txt | wc -l) == 4 ] @@ -34,11 +32,11 @@ // RUN: rm -rf %T/coverage-missing // RUN: mkdir -p %T/coverage-missing // RUN: cd %T/coverage-missing -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x +// RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x // RUN: %sancov print $LIBNAME.*.sancov > foo.txt // RUN: rm *.sancov // RUN: [ $(cat foo.txt | wc -l) == 2 ] -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x x +// RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x x // RUN: %sancov print $LIBNAME.*.sancov > bar.txt // RUN: rm *.sancov // RUN: [ $(cat bar.txt | wc -l) == 3 ] diff --git a/compiler-rt/test/asan/TestCases/Linux/init-order-dlopen.cc b/compiler-rt/test/asan/TestCases/Linux/init-order-dlopen.cc index fcfb5d143df..d469b98089f 100644 --- a/compiler-rt/test/asan/TestCases/Linux/init-order-dlopen.cc +++ b/compiler-rt/test/asan/TestCases/Linux/init-order-dlopen.cc @@ -3,7 +3,7 @@ // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O0 %s %libdl -Wl,--export-dynamic -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true %run %t 2>&1 +// RUN: %env_asan_opts=strict_init_order=true %run %t 2>&1 // dlopen() can not be intercepted on Android, making strict_init_order nearly // useless there. diff --git a/compiler-rt/test/asan/TestCases/Linux/initialization-bug-any-order.cc b/compiler-rt/test/asan/TestCases/Linux/initialization-bug-any-order.cc index 0f2fccae79b..85fefd40ee0 100644 --- a/compiler-rt/test/asan/TestCases/Linux/initialization-bug-any-order.cc +++ b/compiler-rt/test/asan/TestCases/Linux/initialization-bug-any-order.cc @@ -4,9 +4,9 @@ // strict init-order checking). // RUN: %clangxx_asan -O0 %s %p/../Helpers/initialization-bug-extra.cc -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %p/../Helpers/initialization-bug-extra.cc %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s // Do not test with optimization -- the error may be optimized away. diff --git a/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc b/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc index 8d3f7d6f8e8..c0f17272ad2 100644 --- a/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc +++ b/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc @@ -4,9 +4,9 @@ // Test that kernel area is not sanitized on 32-bit machines. // // RUN: %clangxx_asan %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1:full_address_space=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1:full_address_space=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-kernel-64-bits +// RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits +// RUN: %env_asan_opts=verbosity=1:full_address_space=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits +// RUN: %env_asan_opts=verbosity=1:full_address_space=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-kernel-64-bits // // CHECK-kernel-32-bits: || `[0x38{{0+}}, 0xb{{f+}}]` || HighMem || // CHECK-kernel-32-bits: || `[0x27{{0+}}, 0x37{{f+}}]` || HighShadow || diff --git a/compiler-rt/test/asan/TestCases/Linux/leak.cc b/compiler-rt/test/asan/TestCases/Linux/leak.cc index 15c03b45e4c..e22cd6eac16 100644 --- a/compiler-rt/test/asan/TestCases/Linux/leak.cc +++ b/compiler-rt/test/asan/TestCases/Linux/leak.cc @@ -2,9 +2,9 @@ // REQUIRES: leak-detection // // RUN: %clangxx_asan %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_leaks=1 not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_leaks=0 %run %t +// RUN: %env_asan_opts=detect_leaks=1 not %run %t 2>&1 | FileCheck %s +// RUN: not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=detect_leaks=0 %run %t #include <stdio.h> int *t; diff --git a/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc b/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc index f7c7c5fe3df..e8c9b7480b7 100644 --- a/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc +++ b/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc @@ -1,6 +1,6 @@ // RUN: %clangxx_asan -O2 %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW +// RUN: %env_asan_opts=fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST +// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW // Test how well we unwind in presence of qsort in the stack // (i.e. if we can unwind through a function compiled w/o frame pointers). diff --git a/compiler-rt/test/asan/TestCases/Linux/malloc_delete_mismatch.cc b/compiler-rt/test/asan/TestCases/Linux/malloc_delete_mismatch.cc index 33d0ede15f3..66eed33052c 100644 --- a/compiler-rt/test/asan/TestCases/Linux/malloc_delete_mismatch.cc +++ b/compiler-rt/test/asan/TestCases/Linux/malloc_delete_mismatch.cc @@ -4,14 +4,14 @@ // RUN: %clangxx_asan -g %s -o %t 2>&1 // Find error and provide malloc context. -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=ALLOC-STACK +// RUN: %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=ALLOC-STACK // No error here. -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:alloc_dealloc_mismatch=0 %run %t +// RUN: %env_asan_opts=alloc_dealloc_mismatch=0 %run %t // Also works if no malloc context is available. -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include <stdlib.h> diff --git a/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc b/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc index aeb70c94ec9..2758f0ad04f 100644 --- a/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc @@ -3,8 +3,8 @@ // where asan consumed too much RAM due to transparent hugetables. // // RUN: %clangxx_asan -g %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:no_huge_pages_for_shadow=1 %run %t 2>&1 | FileCheck %s -// RUN: %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=no_huge_pages_for_shadow=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s // // Would be great to run the test with no_huge_pages_for_shadow=0, but // the result will depend on the OS version and settings... diff --git a/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc b/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc index e9311d16bd5..bc76116632e 100644 --- a/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc +++ b/compiler-rt/test/asan/TestCases/Linux/odr-violation.cc @@ -7,20 +7,20 @@ // Different size: detect a bug if detect_odr_violation>=1 // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t-ODR-SO.so // RUN: %clangxx_asan %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0:detect_odr_violation=1 not %run %t-ODR-EXE 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0:detect_odr_violation=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s +// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 not %run %t-ODR-EXE 2>&1 | FileCheck %s +// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s +// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED +// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s // // Same size: report a bug only if detect_odr_violation>=2. // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t-ODR-SO.so -DSZ=100 -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0:detect_odr_violation=1 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s +// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED +// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s +// RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s // RUN: echo "odr_violation:foo::ZZZ" > %t.supp -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.supp not %run %t-ODR-EXE 2>&1 | FileCheck %s +// 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 // RUN: echo "odr_violation:foo::G" > %t.supp -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.supp %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED +// 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 // RUN: rm -f %t.supp // GNU driver doesn't handle .so files properly. diff --git a/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc b/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc index 26fe67d6072..dc3918e876a 100644 --- a/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc +++ b/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc @@ -1,6 +1,6 @@ // RUN: %clangxx_asan -O2 %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_fatal=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:fast_unwind_on_fatal=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW +// RUN: %env_asan_opts=fast_unwind_on_fatal=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST +// RUN: %env_asan_opts=fast_unwind_on_fatal=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW // Test how well we unwind in presence of qsort in the stack // (i.e. if we can unwind through a function compiled w/o frame pointers). diff --git a/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc b/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc index 1820cb90c4e..cbacec22fa1 100644 --- a/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc +++ b/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc @@ -1,10 +1,10 @@ // Test quarantine_size_mb (and the deprecated quarantine_size) // RUN: %clangxx_asan %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size=10485760:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size_mb=10:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size_mb=10:quarantine_size=20:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=BOTH -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size_mb=1000:hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT +// RUN: %env_asan_opts=quarantine_size=10485760:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 +// RUN: %env_asan_opts=quarantine_size_mb=10:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 +// RUN: %env_asan_opts=quarantine_size_mb=10:quarantine_size=20:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=BOTH +// RUN: %env_asan_opts=quarantine_size_mb=1000:hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT +// RUN: %env_asan_opts=hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT #include <string.h> char *g; diff --git a/compiler-rt/test/asan/TestCases/Linux/sized_delete_test.cc b/compiler-rt/test/asan/TestCases/Linux/sized_delete_test.cc index 1146b8239d8..5d8c7010e31 100644 --- a/compiler-rt/test/asan/TestCases/Linux/sized_delete_test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/sized_delete_test.cc @@ -1,10 +1,10 @@ // RUN: %clangxx_asan -fsized-deallocation -O0 %s -o %t // RUN: not %run %t scalar 2>&1 | FileCheck %s -check-prefix=SCALAR -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:new_delete_type_mismatch=1 not %run %t scalar 2>&1 | FileCheck %s -check-prefix=SCALAR +// RUN: %env_asan_opts=new_delete_type_mismatch=1 not %run %t scalar 2>&1 | FileCheck %s -check-prefix=SCALAR // RUN: not %run %t array 2>&1 | FileCheck %s -check-prefix=ARRAY -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:new_delete_type_mismatch=1 not %run %t array 2>&1 | FileCheck %s -check-prefix=ARRAY -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:new_delete_type_mismatch=0 %run %t scalar -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:new_delete_type_mismatch=0 %run %t array +// RUN: %env_asan_opts=new_delete_type_mismatch=1 not %run %t array 2>&1 | FileCheck %s -check-prefix=ARRAY +// RUN: %env_asan_opts=new_delete_type_mismatch=0 %run %t scalar +// RUN: %env_asan_opts=new_delete_type_mismatch=0 %run %t array #include <new> #include <stdio.h> diff --git a/compiler-rt/test/asan/TestCases/Linux/stack-overflow-sigbus.cc b/compiler-rt/test/asan/TestCases/Linux/stack-overflow-sigbus.cc index 23c4d23ce40..8c9599c9f61 100644 --- a/compiler-rt/test/asan/TestCases/Linux/stack-overflow-sigbus.cc +++ b/compiler-rt/test/asan/TestCases/Linux/stack-overflow-sigbus.cc @@ -1,6 +1,6 @@ // Test ASan detection of stack-overflow condition when Linux sends SIGBUS. -// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s #include <assert.h> #include <stdio.h> diff --git a/compiler-rt/test/asan/TestCases/Linux/stack-trace-dlclose.cc b/compiler-rt/test/asan/TestCases/Linux/stack-trace-dlclose.cc index f207a94ae65..49c20897801 100644 --- a/compiler-rt/test/asan/TestCases/Linux/stack-trace-dlclose.cc +++ b/compiler-rt/test/asan/TestCases/Linux/stack-trace-dlclose.cc @@ -3,7 +3,7 @@ // // RUN: %clangxx_asan -DSHARED %s -shared -o %T/stack_trace_dlclose.so -fPIC // RUN: %clangxx_asan -DSO_DIR=\"%T\" %s %libdl -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:exitcode=0 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=exitcode=0 %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf diff --git a/compiler-rt/test/asan/TestCases/Linux/static_tls.cc b/compiler-rt/test/asan/TestCases/Linux/static_tls.cc index 6e9724f328f..ff699f3d60c 100644 --- a/compiler-rt/test/asan/TestCases/Linux/static_tls.cc +++ b/compiler-rt/test/asan/TestCases/Linux/static_tls.cc @@ -3,7 +3,7 @@ // // RUN: %clangxx_asan -DSHARED %s -shared -o %t-so.so -fPIC // RUN: %clangxx_asan %s -ldl -pthread -o %t %t-so.so -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=verbosity=2 %run %t 2>&1 | FileCheck %s // CHECK: before // CHECK: __tls_get_addr: static tls diff --git a/compiler-rt/test/asan/TestCases/Linux/stress_dtls.c b/compiler-rt/test/asan/TestCases/Linux/stress_dtls.c index 7af33b9457e..bbf4b3e0efe 100644 --- a/compiler-rt/test/asan/TestCases/Linux/stress_dtls.c +++ b/compiler-rt/test/asan/TestCases/Linux/stress_dtls.c @@ -12,9 +12,9 @@ // RUN: %clangxx_asan %s -ldl -pthread -o %t // RUN: %run %t 0 3 // RUN: %run %t 2 3 -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 %run %t 10 2 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2:intercept_tls_get_addr=1 %run %t 10 2 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2:intercept_tls_get_addr=0 %run %t 10 2 2>&1 | FileCheck %s --check-prefix=CHECK0 +// RUN: %env_asan_opts=verbosity=2 %run %t 10 2 2>&1 | FileCheck %s +// RUN: %env_asan_opts=verbosity=2:intercept_tls_get_addr=1 %run %t 10 2 2>&1 | FileCheck %s +// RUN: %env_asan_opts=verbosity=2:intercept_tls_get_addr=0 %run %t 10 2 2>&1 | FileCheck %s --check-prefix=CHECK0 // CHECK: __tls_get_addr // CHECK: Creating thread 0 // CHECK: __tls_get_addr diff --git a/compiler-rt/test/asan/TestCases/Posix/allow_user_segv.cc b/compiler-rt/test/asan/TestCases/Posix/allow_user_segv.cc index ecb3a894ffd..69c1df9a1d3 100644 --- a/compiler-rt/test/asan/TestCases/Posix/allow_user_segv.cc +++ b/compiler-rt/test/asan/TestCases/Posix/allow_user_segv.cc @@ -1,8 +1,8 @@ // Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=180 -// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O2 %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s #include <signal.h> #include <stdio.h> diff --git a/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc b/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc index 043130f9e54..dd59e4a6077 100644 --- a/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc +++ b/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc @@ -6,7 +6,7 @@ // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O0 %s %libdl -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s +// RUN: %env_asan_opts=symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc index af73f5d2952..0af3296f22d 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc @@ -7,11 +7,11 @@ // RUN: rm -rf %T/coverage-direct-activation // RUN: mkdir -p %T/coverage-direct-activation/normal -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1,coverage_direct=0,coverage_dir=%T/coverage-direct-activation/normal:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1,coverage_direct=1,verbosity=1 \ +// RUN: %env_asan_opts=start_deactivated=1,coverage_direct=1,verbosity=1 \ // 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 @@ -23,7 +23,7 @@ // RUN: diff -u coverage-direct-activation/normal/out.txt coverage-direct-activation/direct/out.txt // RUN: mkdir -p %T/coverage-direct-activation/direct2 -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1,coverage=1,coverage_direct=1,verbosity=1 \ +// RUN: %env_asan_opts=start_deactivated=1,coverage=1,coverage_direct=1,verbosity=1 \ // 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 diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc index 2769172c39a..367a5667a71 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc @@ -8,12 +8,12 @@ // RUN: rm -rf %T/coverage-direct-large // RUN: mkdir -p %T/coverage-direct-large/normal && cd %T/coverage-direct-large/normal -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=0:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=coverage=1:coverage_direct=1:verbosity=1 %run %t %dynamiclib // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc index 5371a859c24..8caa9c553f2 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc @@ -6,11 +6,11 @@ // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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 @@ -25,11 +25,11 @@ // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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 @@ -44,11 +44,11 @@ // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc index 39363911fec..c1967195380 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc @@ -1,7 +1,7 @@ // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // RUN: rm -rf %T/coverage-fork-direct // RUN: mkdir -p %T/coverage-fork-direct && cd %T/coverage-fork-direct -// RUN: (ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:verbosity=1 %run %t; \ +// RUN: (%env_asan_opts=coverage=1:coverage_direct=1:verbosity=1 %run %t; \ // RUN: %sancov rawunpack *.sancov.raw; %sancov print *.sancov) 2>&1 // // XFAIL: android diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cc index c1f0fc3a84b..799d71638a2 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cc @@ -1,8 +1,7 @@ // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -// RUN: export ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=0:verbosity=1 // RUN: rm -rf %T/coverage-fork // RUN: mkdir -p %T/coverage-fork && cd %T/coverage-fork -// RUN: %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=coverage=1:coverage_direct=0:verbosity=1 %run %t 2>&1 | FileCheck %s // // XFAIL: android diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc index fe08bdd792b..d492af6662f 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc @@ -3,10 +3,9 @@ // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib1 -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib2 -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func %s %libdl -o %t -// RUN: export ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 // RUN: mkdir -p %T/coverage-module-unloaded && cd %T/coverage-module-unloaded -// RUN: %run %t %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s -// RUN: %run %t %dynamiclib1 %dynamiclib2 foo 2>&1 | FileCheck %s +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s +// RUN: %env_asan_opts=coverage=1:verbosity=1 %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 diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc index dd2c1ec43be..f6fc5266607 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc @@ -1,16 +1,16 @@ // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t %ld_flags_rpath_exe -// RUN: export ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 + // RUN: rm -rf %T/coverage_sandboxing_test // RUN: mkdir %T/coverage_sandboxing_test && cd %T/coverage_sandboxing_test // RUN: mkdir vanilla && cd vanilla -// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-vanilla +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-vanilla // RUN: mkdir ../sandbox1 && cd ../sandbox1 -// RUN: %run %t a 2>&1 | FileCheck %s --check-prefix=CHECK-sandbox -// RUN: %sancov unpack coverage_sandboxing_test.sancov.packed +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t a 2>&1 | FileCheck %s --check-prefix=CHECK-sandbox +// RUN: %sancov unpack coverage_sandboxing_test.sancov.packed // RUN: mkdir ../sandbox2 && cd ../sandbox2 -// RUN: %run %t a b 2>&1 | FileCheck %s --check-prefix=CHECK-sandbox -// RUN: %sancov unpack coverage_sandboxing_test.sancov.packed +// RUN: %env_asan_opts=coverage=1:verbosity=1 %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/`basename %dynamiclib`*.sancov > vanilla.txt // RUN: %sancov print sandbox1/`basename %dynamiclib`*.sancov > sandbox1.txt @@ -18,6 +18,7 @@ // RUN: diff vanilla.txt sandbox1.txt // RUN: diff vanilla.txt sandbox2.txt // 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/Posix/coverage.cc b/compiler-rt/test/asan/TestCases/Posix/coverage.cc index 99e348fdaf9..7c1c4949f60 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage.cc @@ -1,20 +1,19 @@ // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so // RUN: %clangxx_asan -fsanitize-coverage=func %s %ld_flags_rpath_exe -o %t -// RUN: export ASAN_OPTIONS=$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: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main // 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: %env_asan_opts=coverage=1:verbosity=1 %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-foo // 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: %env_asan_opts=coverage=1:verbosity=1 %run %t bar 2>&1 | FileCheck %s --check-prefix=CHECK-bar // 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: %env_asan_opts=coverage=1:verbosity=1 %run %t foo bar 2>&1 | FileCheck %s --check-prefix=CHECK-foo-bar // 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: %env_asan_opts=coverage=1:verbosity=1 not %run %t foo bar 4 2>&1 | FileCheck %s --check-prefix=CHECK-report +// RUN: %env_asan_opts=coverage=1:verbosity=1 not %run %t foo bar 4 5 2>&1 | FileCheck %s --check-prefix=CHECK-segv // RUN: rm -r %T/coverage // // https://code.google.com/p/address-sanitizer/issues/detail?id=263 diff --git a/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cc b/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cc index f6421b8afe6..18ba563dbd2 100644 --- a/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cc +++ b/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cc @@ -1,10 +1,9 @@ // Check that UAR mode can handle very deep recusrion. -// RUN: export ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 // RUN: %clangxx_asan -O2 %s -o %t && \ -// RUN: (ulimit -s 4096; %run %t) 2>&1 | FileCheck %s +// RUN: (ulimit -s 4096; %env_asan_opts=detect_stack_use_after_return=1 %run %t) 2>&1 | FileCheck %s // Also check that use_sigaltstack+verbosity doesn't crash. -// RUN: %env_asan_opts=verbosity=1:use_sigaltstack=1 %run %t | FileCheck %s +// RUN: %env_asan_opts=verbosity=1:use_sigaltstack=1:detect_stack_use_after_return=1 %run %t | FileCheck %s #include <stdio.h> __attribute__((noinline)) diff --git a/compiler-rt/test/asan/TestCases/Posix/ioctl.cc b/compiler-rt/test/asan/TestCases/Posix/ioctl.cc index d25f6ecbee1..6cf9fa8e3cd 100644 --- a/compiler-rt/test/asan/TestCases/Posix/ioctl.cc +++ b/compiler-rt/test/asan/TestCases/Posix/ioctl.cc @@ -1,5 +1,5 @@ -// RUN: %clangxx_asan -O0 -g %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:handle_ioctl=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 -g %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:handle_ioctl=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 -g %s -o %t && %env_asan_opts=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 -g %s -o %t && %env_asan_opts=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 -g %s -o %t && %run %t // RUN: %clangxx_asan -O3 -g %s -o %t && %run %t diff --git a/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc b/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc index b1c99430c75..b39fa74a314 100644 --- a/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc +++ b/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc @@ -2,7 +2,7 @@ // RUN: %clangxx_asan %s -o %t // The memory is released only when the deallocated chunk leaves the quarantine, // otherwise the mmap(p, ...) call overwrites the malloc header. -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size_mb=0 %run %t +// RUN: %env_asan_opts=quarantine_size_mb=0 %run %t #include <assert.h> #include <string.h> diff --git a/compiler-rt/test/asan/TestCases/Posix/log_path_fork_test.cc.disabled b/compiler-rt/test/asan/TestCases/Posix/log_path_fork_test.cc.disabled index 9f09b78f41c..029bdd1e337 100644 --- a/compiler-rt/test/asan/TestCases/Posix/log_path_fork_test.cc.disabled +++ b/compiler-rt/test/asan/TestCases/Posix/log_path_fork_test.cc.disabled @@ -1,7 +1,7 @@ // RUN: %clangxx_asan %s -o %t // RUN: rm -f %t.log.* // Set verbosity to 1 so that the log files are opened prior to fork(). -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:log_path=%t.log verbosity=1" not %run %t 2> %t.out +// RUN: %env_asan_opts=log_path='"%t.log"':verbosity=1 not %run %t 2> %t.out // RUN: for f in %t.log.* ; do FileCheck %s < $f; done // RUN: [ `ls %t.log.* | wc -l` == 2 ] diff --git a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cc b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cc index bc681857ae6..dd50bf7fe6a 100644 --- a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cc +++ b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cc @@ -1,8 +1,8 @@ // REQUIRES: asan-64-bits // RUN: %clangxx_asan -O3 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:poison_array_cookie=0 not %run %t 2>&1 | FileCheck %s --check-prefix=NO_COOKIE +// RUN: %env_asan_opts=poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=poison_array_cookie=0 not %run %t 2>&1 | FileCheck %s --check-prefix=NO_COOKIE #include <stdio.h> #include <stdlib.h> struct C { diff --git a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_uaf_test.cc b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_uaf_test.cc index 5998d06756d..f36da2b5438 100644 --- a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_uaf_test.cc +++ b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_uaf_test.cc @@ -1,7 +1,7 @@ // REQUIRES: asan-64-bits // RUN: %clangxx_asan -O3 %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s --check-prefix=COOKIE -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:poison_array_cookie=0 not %run %t 2>&1 | FileCheck %s --check-prefix=NO_COOKIE +// RUN: %env_asan_opts=poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s --check-prefix=COOKIE +// RUN: %env_asan_opts=poison_array_cookie=0 not %run %t 2>&1 | FileCheck %s --check-prefix=NO_COOKIE #include <stdio.h> #include <stdlib.h> #include <assert.h> diff --git a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc index 78901509c43..cf114be97d5 100644 --- a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc +++ b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc @@ -1,14 +1,13 @@ -// RUN: export ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 -// RUN: %clangxx_asan -O0 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O1 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O2 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O1 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O2 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t // Regression test for a CHECK failure with small stack size and large frame. -// RUN: %clangxx_asan -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s +// RUN: %clangxx_asan -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s // // Test that we can find UAR in a thread other than main: -// RUN: %clangxx_asan -DUseThread -O2 %s -pthread -o %t && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s +// RUN: %clangxx_asan -DUseThread -O2 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s // // Test the max_uar_stack_size_log/min_uar_stack_size_log flag. // diff --git a/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc b/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc index 2ca8015fc74..b3014154901 100644 --- a/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc +++ b/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc @@ -5,17 +5,17 @@ // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx -O0 %s -c -o %t.o // RUN: %clangxx_asan -O0 %t.o %libdl -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1,allocator_may_return_null=0 \ +// RUN: %env_asan_opts=start_deactivated=1,allocator_may_return_null=0 \ // RUN: ASAN_ACTIVATION_OPTIONS=allocator_may_return_null=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \ +// RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-HELP -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1,verbosity=1 \ +// RUN: %env_asan_opts=start_deactivated=1,verbosity=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \ +// RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED-V0 // Check that verbosity=1 in activation flags affects reporting of unrecognized activation flags. -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \ +// RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0,verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED // XFAIL: arm-linux-gnueabi diff --git a/compiler-rt/test/asan/TestCases/Posix/tsd_dtor_leak.cc b/compiler-rt/test/asan/TestCases/Posix/tsd_dtor_leak.cc index 69d28194fb9..9e71ff61cf0 100644 --- a/compiler-rt/test/asan/TestCases/Posix/tsd_dtor_leak.cc +++ b/compiler-rt/test/asan/TestCases/Posix/tsd_dtor_leak.cc @@ -1,7 +1,7 @@ // Regression test for a leak in tsd: // https://code.google.com/p/address-sanitizer/issues/detail?id=233 // RUN: %clangxx_asan -O1 %s -pthread -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size_mb=0 %run %t +// RUN: %env_asan_opts=quarantine_size_mb=0 %run %t #include <pthread.h> #include <stdio.h> #include <stdlib.h> diff --git a/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cc b/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cc index 44b499fcb4c..0ff105d1624 100644 --- a/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cc +++ b/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cc @@ -1,7 +1,7 @@ // RUN: rm -rf %T/coverage-basic // RUN: mkdir %T/coverage-basic && cd %T/coverage-basic // RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe -// RUN: env ASAN_OPTIONS=coverage=1 %run ./test.exe +// RUN: %env_asan_opts=coverage=1 %run ./test.exe // // RUN: %sancov print *.sancov | FileCheck %s #include <stdio.h> diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc b/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc index fbdb1c145bb..e07f26f0834 100644 --- a/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc +++ b/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc @@ -1,6 +1,6 @@ // RUN: %clang_cl_asan -LD -O0 -DDLL %s -Fe%t.dll // RUN: %clang_cl_asan -O0 -DEXE %s %t.lib -Fe%te.exe -// RUN: env ASAN_OPTIONS=report_globals=2 %run %te.exe 2>&1 | FileCheck %s +// RUN: %env_asan_opts=report_globals=2 %run %te.exe 2>&1 | FileCheck %s // FIXME: Currently, the MT runtime build crashes on startup due to dbghelp.dll // initialization failure. diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cc b/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cc index 615cc16116c..64287184692 100644 --- a/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cc +++ b/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cc @@ -1,6 +1,6 @@ // RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll -// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s +// RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s #include <malloc.h> diff --git a/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cc b/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cc index 3062318e0db..d83d7dc264a 100644 --- a/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cc +++ b/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cc @@ -1,5 +1,5 @@ // RUN: %clangxx_asan -O0 %s -o %t -// RUN: env ASAN_OPTIONS=external_symbolizer_path=asdf not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=external_symbolizer_path=asdf not %run %t 2>&1 | FileCheck %s #include <windows.h> #include <dbghelp.h> diff --git a/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc b/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc index 8b050975aac..4adbcc3b529 100644 --- a/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc +++ b/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc @@ -1,7 +1,7 @@ // Make sure we can handle reloading the same DLL multiple times. // RUN: %clang_cl_asan -LD -O0 -DDLL %s -Fe%t.dll // RUN: %clang_cl_asan -O0 -DEXE %s -Fe%te.exe -// RUN: env ASAN_OPTIONS=report_globals=1 %run %te.exe %t.dll 2>&1 | FileCheck %s +// RUN: %env_asan_opts=report_globals=1 %run %te.exe %t.dll 2>&1 | FileCheck %s #include <windows.h> #include <stdio.h> diff --git a/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc b/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc index 72bf36ad0be..94b97f58f28 100644 --- a/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc +++ b/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc @@ -1,6 +1,6 @@ // RUN: %clang_cl_asan -LD -O0 -DDLL %s -Fe%t.dll // RUN: %clang_cl_asan -O0 -DEXE %s -Fe%te.exe -// RUN: env ASAN_OPTIONS=report_globals=2 %run %te.exe %t.dll 2>&1 | FileCheck %s +// RUN: %env_asan_opts=report_globals=2 %run %te.exe %t.dll 2>&1 | FileCheck %s #include <windows.h> #include <stdio.h> diff --git a/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cc b/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cc index a770fd8db3c..9c31922af1d 100644 --- a/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cc +++ b/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cc @@ -1,5 +1,5 @@ // RUN: %clang_cl_asan -O0 %s -Fe%t -// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s char *x; diff --git a/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cc b/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cc index 84f0262dc0b..740cecee15c 100644 --- a/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cc +++ b/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cc @@ -9,18 +9,18 @@ // RUN: %clangxx_asan -O0 %s -o %T/suppressions-exec-relative-location/exec // RUN: echo "interceptor_via_fun:crash_function" > \ // RUN: %T/suppressions-exec-relative-location/supp.txt -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions=supp.txt" \ +// RUN: %env_asan_opts=suppressions='"supp.txt"' \ // RUN: %run %T/suppressions-exec-relative-location/exec 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-IGNORE %s // RUN: rm -rf %T/suppressions-exec-relative-location // If the wrong absolute path is given, we don't try to construct // a relative path with it. -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='/absolute/path'" not %run %t 2>&1 | \ +// RUN: %env_asan_opts=suppressions='"/absolute/path"' not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-WRONG-FILE-NAME %s // Test that we reject directory as filename. -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='folder/only/'" not %run %t 2>&1 | \ +// RUN: %env_asan_opts=suppressions='"folder/only/"' not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-WRONG-FILE-NAME %s // XFAIL: android diff --git a/compiler-rt/test/asan/TestCases/suppressions-interceptor.cc b/compiler-rt/test/asan/TestCases/suppressions-interceptor.cc index aaa2c7b0f0c..e44ccb8e652 100644 --- a/compiler-rt/test/asan/TestCases/suppressions-interceptor.cc +++ b/compiler-rt/test/asan/TestCases/suppressions-interceptor.cc @@ -3,10 +3,9 @@ // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // RUN: echo "interceptor_name:strlen" > %t.supp -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s +// RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s -// FIXME: Windows symbolizer needs work to make this pass. -// XFAIL: android,win32 +// XFAIL: android #include <stdio.h> #include <stdlib.h> diff --git a/compiler-rt/test/asan/TestCases/uar_and_exceptions.cc b/compiler-rt/test/asan/TestCases/uar_and_exceptions.cc index bdeca434e6c..324e8a52bd5 100644 --- a/compiler-rt/test/asan/TestCases/uar_and_exceptions.cc +++ b/compiler-rt/test/asan/TestCases/uar_and_exceptions.cc @@ -1,6 +1,6 @@ // Test that use-after-return works with exceptions. -// export ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 -// RUN: %clangxx_asan -O0 %s -o %t && %run %t +// RUN: %clangxx_asan -O0 %s -o %t +// RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t // Clang doesn't support exceptions on Windows yet. // XFAIL: win32 diff --git a/compiler-rt/test/asan/TestCases/use-after-scope.cc b/compiler-rt/test/asan/TestCases/use-after-scope.cc index e244ee34b10..59a0e0cd6e4 100644 --- a/compiler-rt/test/asan/TestCases/use-after-scope.cc +++ b/compiler-rt/test/asan/TestCases/use-after-scope.cc @@ -1,6 +1,6 @@ // RUN: %clangxx_asan -O0 -fsanitize=use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:detect_stack_use_after_return=1" not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // XFAIL: * int main() { |

