[ASan] Test churn for setting ASAN_OPTIONS=symbolize_vs_style=false
authorFilipe Cabecinhas <me@filcab.net>
Mon, 15 Jun 2015 20:43:42 +0000 (20:43 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Mon, 15 Jun 2015 20:43:42 +0000 (20:43 +0000)
Summary:
This commit adds symbolize_vs_style=false to every instance of
ASAN_OPTIONS in the asan tests and sets
ASAN_OPTIONS=symbolize_vs_style=false in lit, for tests which don't set
it.

This way we don't need to make the tests be able to deal with both
symbolize styles.

This is the first patch in the series. I will eventually submit for the
other sanitizers too.

We need this change (or another way to deal with the different outputs) in
order to be able to default to symbolize_vs_style=true on some platforms.

Adding to this change, I'm also adding "env " before any command line
which sets environment variables. That way the test works on other host
shells, like we have if the host is running Windows.

Reviewers: samsonov, kcc, rnk

Subscribers: tberghammer, llvm-commits

Differential Revision: http://reviews.llvm.org/D10294

llvm-svn: 239754

132 files changed:
compiler-rt/test/asan/TestCases/Android/coverage-android.cc
compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cc
compiler-rt/test/asan/TestCases/Darwin/dladdr-demangling.cc
compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc
compiler-rt/test/asan/TestCases/Darwin/reexec-insert-libraries-env.cc
compiler-rt/test/asan/TestCases/Darwin/sandbox-symbolizer.cc
compiler-rt/test/asan/TestCases/Darwin/suppressions-darwin.cc
compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cc
compiler-rt/test/asan/TestCases/Darwin/unset-insert-libraries-on-exec.cc
compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc
compiler-rt/test/asan/TestCases/Linux/asan_preload_test-1.cc
compiler-rt/test/asan/TestCases/Linux/asan_preload_test-2.cc
compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc
compiler-rt/test/asan/TestCases/Linux/init-order-dlopen.cc
compiler-rt/test/asan/TestCases/Linux/initialization-bug-any-order.cc
compiler-rt/test/asan/TestCases/Linux/kernel-area.cc
compiler-rt/test/asan/TestCases/Linux/leak.cc
compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc
compiler-rt/test/asan/TestCases/Linux/malloc_delete_mismatch.cc
compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc
compiler-rt/test/asan/TestCases/Linux/odr-violation.cc
compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc
compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc
compiler-rt/test/asan/TestCases/Linux/sized_delete_test.cc
compiler-rt/test/asan/TestCases/Linux/stack-overflow-sigbus.cc
compiler-rt/test/asan/TestCases/Linux/stack-trace-dlclose.cc
compiler-rt/test/asan/TestCases/Linux/static_tls.cc
compiler-rt/test/asan/TestCases/Linux/stress_dtls.c
compiler-rt/test/asan/TestCases/Posix/allow_user_segv.cc
compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc
compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc
compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc
compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc
compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc
compiler-rt/test/asan/TestCases/Posix/coverage-fork.cc
compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc
compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc
compiler-rt/test/asan/TestCases/Posix/coverage.cc
compiler-rt/test/asan/TestCases/Posix/ioctl.cc
compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc
compiler-rt/test/asan/TestCases/Posix/log_path_fork_test.cc.disabled
compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cc
compiler-rt/test/asan/TestCases/Posix/new_array_cookie_uaf_test.cc
compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc
compiler-rt/test/asan/TestCases/Posix/tsd_dtor_leak.cc
compiler-rt/test/asan/TestCases/Windows/coverage-basic.cc
compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc
compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cc
compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc
compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc
compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cc
compiler-rt/test/asan/TestCases/allocator_returns_null.cc
compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cc
compiler-rt/test/asan/TestCases/asan_options-help.cc
compiler-rt/test/asan/TestCases/atexit_stats.cc
compiler-rt/test/asan/TestCases/atoi_strict.c
compiler-rt/test/asan/TestCases/atol_strict.c
compiler-rt/test/asan/TestCases/atoll_strict.c
compiler-rt/test/asan/TestCases/closed-fds.cc
compiler-rt/test/asan/TestCases/contiguous_container_crash.cc
compiler-rt/test/asan/TestCases/coverage-and-lsan.cc
compiler-rt/test/asan/TestCases/coverage-caller-callee-total-count.cc
compiler-rt/test/asan/TestCases/coverage-caller-callee.cc
compiler-rt/test/asan/TestCases/coverage-disabled.cc
compiler-rt/test/asan/TestCases/coverage-levels.cc
compiler-rt/test/asan/TestCases/coverage-maybe-open-file.cc
compiler-rt/test/asan/TestCases/coverage-order-pcs.cc
compiler-rt/test/asan/TestCases/coverage-reset.cc
compiler-rt/test/asan/TestCases/coverage-tracing.cc
compiler-rt/test/asan/TestCases/debug_mapping.cc
compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc
compiler-rt/test/asan/TestCases/deep_call_stack.cc
compiler-rt/test/asan/TestCases/deep_stack_uaf.cc
compiler-rt/test/asan/TestCases/double-free.cc
compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc
compiler-rt/test/asan/TestCases/gc-test.cc
compiler-rt/test/asan/TestCases/heap-overflow.cc
compiler-rt/test/asan/TestCases/heavy_uar_test.cc
compiler-rt/test/asan/TestCases/init-order-atexit.cc
compiler-rt/test/asan/TestCases/init-order-pthread-create.cc
compiler-rt/test/asan/TestCases/initialization-blacklist.cc
compiler-rt/test/asan/TestCases/initialization-bug.cc
compiler-rt/test/asan/TestCases/initialization-constexpr.cc
compiler-rt/test/asan/TestCases/initialization-nobug.cc
compiler-rt/test/asan/TestCases/invalid-free.cc
compiler-rt/test/asan/TestCases/log-path_test.cc
compiler-rt/test/asan/TestCases/malloc_context_size.cc
compiler-rt/test/asan/TestCases/malloc_fill.cc
compiler-rt/test/asan/TestCases/max_redzone.cc
compiler-rt/test/asan/TestCases/memcmp_strict_test.cc
compiler-rt/test/asan/TestCases/mmap_limit_mb.cc
compiler-rt/test/asan/TestCases/poison_partial.cc
compiler-rt/test/asan/TestCases/print_summary.cc
compiler-rt/test/asan/TestCases/printf-1.c
compiler-rt/test/asan/TestCases/printf-2.c
compiler-rt/test/asan/TestCases/printf-3.c
compiler-rt/test/asan/TestCases/printf-4.c
compiler-rt/test/asan/TestCases/printf-5.c
compiler-rt/test/asan/TestCases/stack-overflow.cc
compiler-rt/test/asan/TestCases/stack-use-after-return.cc
compiler-rt/test/asan/TestCases/strcasestr-1.c
compiler-rt/test/asan/TestCases/strcasestr-2.c
compiler-rt/test/asan/TestCases/strcasestr_strict.c
compiler-rt/test/asan/TestCases/strcat_strict.c
compiler-rt/test/asan/TestCases/strchr_strict.c
compiler-rt/test/asan/TestCases/strcmp_strict.c
compiler-rt/test/asan/TestCases/strcspn-1.c
compiler-rt/test/asan/TestCases/strcspn-2.c
compiler-rt/test/asan/TestCases/strcspn_strict.c
compiler-rt/test/asan/TestCases/strip_path_prefix.c
compiler-rt/test/asan/TestCases/strncat_strict.c
compiler-rt/test/asan/TestCases/strpbrk-1.c
compiler-rt/test/asan/TestCases/strpbrk-2.c
compiler-rt/test/asan/TestCases/strpbrk_strict.c
compiler-rt/test/asan/TestCases/strspn-1.c
compiler-rt/test/asan/TestCases/strspn-2.c
compiler-rt/test/asan/TestCases/strspn_strict.c
compiler-rt/test/asan/TestCases/strstr-1.c
compiler-rt/test/asan/TestCases/strstr-2.c
compiler-rt/test/asan/TestCases/strstr_strict.c
compiler-rt/test/asan/TestCases/strtol_strict.c
compiler-rt/test/asan/TestCases/strtoll_strict.c
compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cc
compiler-rt/test/asan/TestCases/suppressions-function.cc
compiler-rt/test/asan/TestCases/suppressions-interceptor.cc
compiler-rt/test/asan/TestCases/suppressions-library.cc
compiler-rt/test/asan/TestCases/uar_and_exceptions.cc
compiler-rt/test/asan/TestCases/use-after-poison.cc
compiler-rt/test/asan/TestCases/use-after-scope.cc
compiler-rt/test/asan/TestCases/verbose-log-path_test.cc
compiler-rt/test/asan/lit.cfg

index 8c609636eacdc7673c5398b18253d17040f9c3a0..5f2631605595ddab8135477d2e443502ccafa932 100644 (file)
@@ -9,7 +9,7 @@
 
 // RUN: adb shell mkdir -p %device/coverage-android/direct
 // RUN: mkdir -p %T/coverage-android/direct
-// RUN: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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
index a4df3a2e550412382466027433f88351d59c51a5..8da842238052a6b97768e1651be1e60b61f69633 100644 (file)
@@ -1,10 +1,10 @@
 // Check that the `atos` symbolizer works.
 
 // RUN: %clangxx_asan -O0 %s -o %t 
-// RUN: ASAN_OPTIONS=verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) not %run %t 2>&1 | FileCheck %s
 
 // Check that when having a DYLD_ROOT_PATH set, the symbolizer still works.
-// RUN: DYLD_ROOT_PATH="/" ASAN_OPTIONS=verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) \
+// RUN: env DYLD_ROOT_PATH="/" ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) \
 // RUN:   not %run %t 2>&1 | FileCheck %s
 
 #include <stdlib.h>
index 494007f515a54cedf70913f31dfa40a6f0d2d0c6..3d36c4f963553e8c2729329086cc2af59ccd51d2 100644 (file)
@@ -3,7 +3,7 @@
 
 // RUN: %clangxx_asan -O0 %s -o %t 
 // RUN: not %run %t 2>&1 | FileCheck %s
-// RUN: 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_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
 
 #include <stdlib.h>
 
index 0bd4170a353c6818ecb9f946fdef62e80a532d07..9210bafda8d5292cf28f426dc5812e7c8bbab1d6 100644 (file)
@@ -7,10 +7,10 @@
 // RUN:   | sed -e 's/.*"\(.*libclang_rt.asan_osx_dynamic.dylib\)".*/\1/'` \
 // 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: DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib \
-// RUN:   ASAN_OPTIONS=verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \
+// 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:   | FileCheck %s
-// RUN: ASAN_OPTIONS=verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-NOINSERT %s
 
 #include <stdio.h>
index 59ddd634b400e34cc361ff10562a0a003f1aacfb..aa4d92b00a01762e7b1430acab8ac6120e7d2f8e 100644 (file)
@@ -7,7 +7,7 @@
 // RUN:     -dynamiclib -o darwin-dummy-shared-lib-so.dylib
 
 // FIXME: the following command line may hang in the case of a regression.
-// RUN: DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \
+// RUN: env DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \
 // RUN:     %run %t 2>&1 | FileCheck %s || exit 1
 
 #if !defined(SHARED_LIB)
index 4313371874efdf29f82c49670a2959117a83914a..4310f9c599e3111c5b66d3d4a47d9e0a41f031f6 100644 (file)
@@ -6,11 +6,11 @@
 // RUN: %clangxx_asan -O0 %s -o %t 
 // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s
 // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
-// RUN: ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
+// RUN: env ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O3 %s -o %t 
 // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s
 // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
-// RUN: ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
+// RUN: env ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
 
 #include <stdlib.h>
 int main() {
index fb37296d404fdc1cd7b89c7f4da36d737fde620f..488bff1402250cc5e6e58fe890898289f84f4074 100644 (file)
@@ -4,17 +4,17 @@
 
 // Check that suppressing the interceptor by name works.
 // RUN: echo "interceptor_name:memmove" > %t.supp
-// RUN: ASAN_OPTIONS="suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS: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: ASAN_OPTIONS="suppressions='%t.supp':symbolize=false" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS: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: ASAN_OPTIONS="suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
 
 // Check that suppressing library works even without the symbolizer.
-// RUN: ASAN_OPTIONS="suppressions='%t.supp':symbolize=false" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp':symbolize=false" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
 
 #include <CoreFoundation/CoreFoundation.h>
 
index 59fe475103403e6371a33f7372d5411170537038..47d80f80db2bc298091c8bdfb3b4dbdef33e4f93 100644 (file)
@@ -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: ASAN_OPTIONS=suppressions=%t.supp \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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
 
index ed476b223af381200db46514731ac795ba4d421b..f8a330ad5fe01de43abd47c5bf8b410982df8168 100644 (file)
@@ -10,7 +10,7 @@
 // execl().
 
 // RUN: %run %t %T/echo-env >/dev/null 2>&1
-// RUN: DYLD_INSERT_LIBRARIES=%t-darwin-dummy-shared-lib-so.dylib \
+// RUN: env DYLD_INSERT_LIBRARIES=%t-darwin-dummy-shared-lib-so.dylib \
 // RUN:     %run %t %T/echo-env 2>&1 | FileCheck %s || exit 1
 
 #if !defined(SHARED_LIB)
index 6145c01f7342c2f4a483b8e159905d661563daed..9e58f83d40c68b1a9cfdcac9e20916e0696515a6 100644 (file)
@@ -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: ASAN_OPTIONS=verbosity=1 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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
index e5eab5545b83ba171b6536325db8d756c4b6fd66..4e365b5633f377f6c9efc4ad3d90ff14ad2983e2 100644 (file)
@@ -5,7 +5,7 @@
 // RUN: %clangxx %s %t.so -o %t
 //
 // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so
-// RUN: LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
+// RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
 
 // REQUIRES: asan-dynamic-runtime
 
index 0f22264cf1fb5c9bf35dc18b79c6b3086ca99ce2..488fd52e682a61b4dc86be266eb0416472bf3735 100644 (file)
@@ -1,7 +1,7 @@
 // Test that preloaded runtime works with unsanitized executables.
 //
 // RUN: %clangxx %s -o %t
-// RUN: LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
+// RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
 
 // REQUIRES: asan-dynamic-runtime
 
index 30f1c17700c8ac95afd445794aca77e2cfc30fbf..8cf761c905f80f3b6ebf6570dc1043c5639aebbe 100644 (file)
@@ -2,7 +2,7 @@
 // executable is prohibited.
 //
 // RUN: %clangxx_asan_static %s -o %t
-// RUN: LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
+// RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
 
 // REQUIRES: asan-dynamic-runtime
 // XFAIL: android
index 0c36b830b869274bf73e09ce79a117288c092ac3..4c6ba260510b2fc60196591bfc524ad86b1c425a 100644 (file)
@@ -1,21 +1,21 @@
 // Test for "sancov.py missing ...".
 
-// RUN: ASAN_OPTIONS=coverage=1:coverage_dir=%T/coverage-missing
+// RUN: env 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: ASAN_OPTIONS=$ASAN_OPTIONS %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t
 // RUN: %sancov print *.sancov > main.txt
 // RUN: rm *.sancov
 // RUN: [ $(cat main.txt | wc -l) == 1 ]
-// RUN: ASAN_OPTIONS=$ASAN_OPTIONS %t x
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x
 // RUN: %sancov print *.sancov > foo.txt
 // RUN: rm *.sancov
 // RUN: [ $(cat foo.txt | wc -l) == 3 ]
-// RUN: ASAN_OPTIONS=$ASAN_OPTIONS %t x x
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x x
 // RUN: %sancov print *.sancov > bar.txt
 // RUN: rm *.sancov
 // RUN: [ $(cat bar.txt | wc -l) == 4 ]
 // cd %T
 // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %dynamiclib -DFOOBAR -shared -fPIC
 // RUN: %clangxx_asan -fsanitize-coverage=func %s %dynamiclib -o %t -DMAIN
-// RUN: LIBNAME=`basename %dynamiclib`
+// RUN: env LIBNAME=`basename %dynamiclib`
 // RUN: rm -rf %T/coverage-missing
 // RUN: mkdir -p %T/coverage-missing
 // RUN: cd %T/coverage-missing
-// RUN: ASAN_OPTIONS=$ASAN_OPTIONS %t x
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x
 // RUN: %sancov print $LIBNAME.*.sancov > foo.txt
 // RUN: rm *.sancov
 // RUN: [ $(cat foo.txt | wc -l) == 2 ]
-// RUN: ASAN_OPTIONS=$ASAN_OPTIONS %t x x
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS %t x x
 // RUN: %sancov print $LIBNAME.*.sancov > bar.txt
 // RUN: rm *.sancov
 // RUN: [ $(cat bar.txt | wc -l) == 3 ]
index 17ba9d0996d811443edbc991937af407971ae6a4..a04a84ed87f7663009c1c8e712d1454ba4673129 100644 (file)
@@ -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=strict_init_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true %run %t 2>&1
 
 #if defined(SHARED_LIB)
 #include <stdio.h>
index a462f4a163f1ca40872a435c8f22514095814c4f..0f2fccae79bbaf0e90ffc70832a6b530c91b37c2 100644 (file)
@@ -4,9 +4,9 @@
 // strict init-order checking).
 
 // RUN: %clangxx_asan -O0 %s %p/../Helpers/initialization-bug-extra.cc -o %t
-// RUN: ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true not %run %t 2>&1 | FileCheck %s
 
 // Do not test with optimization -- the error may be optimized away.
 
index 97c1c96ee6e985920d4ec139c73e91c3216f9da0..1b3fe076135f876c8ba2ddfde3c89c4c3922ae4e 100644 (file)
@@ -4,9 +4,9 @@
 // Test that kernel area is not sanitized on 32-bit machines.
 //
 // RUN: %clangxx_asan %s -o %t
-// RUN: ASAN_OPTIONS=verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits
-// RUN: ASAN_OPTIONS=verbosity=1:full_address_space=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits
-// RUN: ASAN_OPTIONS=verbosity=1:full_address_space=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-kernel-64-bits
+// 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
 //
 // CHECK-kernel-32-bits: || `[0x38{{0+}}, 0xb{{f+}}]` || HighMem    ||
 // CHECK-kernel-32-bits: || `[0x27{{0+}}, 0x37{{f+}}]` || HighShadow ||
index 36dc6ddb8adfb8e5b1625932364943483128415c..15c03b45e4c983167cc19675c957b04a98723306 100644 (file)
@@ -2,9 +2,9 @@
 // REQUIRES: leak-detection
 //
 // RUN: %clangxx_asan  %s -o %t
-// RUN: ASAN_OPTIONS=detect_leaks=1 not %run %t  2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=""             not %run %t  2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=detect_leaks=0     %run %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
 #include <stdio.h>
 int *t;
 
index 80af409d66a946488a55ce8336588d9a8f3ef0df..f7c7c5fe3df73d1d27688ed6188eece28fe6a44c 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clangxx_asan -O2 %s -o %t
-// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST
-// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW
+// 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
 
 // 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).
index 18d65ce0008f651fd518b425d447fefd310eb721..33d0ede15f3c0aacb8cfd2990ca6232555a5251c 100644 (file)
@@ -4,14 +4,14 @@
 // RUN: %clangxx_asan -g %s -o %t 2>&1
 
 // Find error and provide malloc context.
-// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=ALLOC-STACK
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=ALLOC-STACK
 
 // No error here.
-// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=0 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:alloc_dealloc_mismatch=0 %run %t
 
 // Also works if no malloc context is available.
-// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
-// RUN: 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_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
 // XFAIL: arm-linux-gnueabi
 // XFAIL: armv7l-unknown-linux-gnueabihf
 #include <stdlib.h>
index 337b95dc05a2a83c72c0f1561ac1ef42e1660aaa..aeb70c94ec994450e7f31c86cab9219d46265160 100644 (file)
@@ -3,8 +3,8 @@
 // where asan consumed too much RAM due to transparent hugetables.
 //
 // RUN: %clangxx_asan -g %s -o %t
-// RUN: ASAN_OPTIONS=no_huge_pages_for_shadow=1 %run %t 2>&1 | FileCheck %s
-// RUN:                                         %run %t 2>&1 | FileCheck %s
+// 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
 //
 // 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...
index ba13cdf002bdff3fbd2a3adc53e33634ec5cac14..e9311d16bd5fb7c2c8c5b6d3edf8259a66835fc3 100644 (file)
@@ -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: ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_odr_violation=1 not %run %t-ODR-EXE 2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_odr_violation=0     %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
-// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0                        not %run %t-ODR-EXE 2>&1 | FileCheck %s
+// 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
 //
 // 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: ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_odr_violation=1     %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
-// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0                        not %run %t-ODR-EXE 2>&1 | FileCheck %s
+// 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: echo "odr_violation:foo::ZZZ" > %t.supp
-// RUN: 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_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: echo "odr_violation:foo::G" > %t.supp
-// RUN: 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_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: rm -f %t.supp
 
 // GNU driver doesn't handle .so files properly.
index 21bdff60cd305afbf66fad22264d23836965c311..26fe67d60729b31315bc527d708197c3d5996d5e 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clangxx_asan -O2 %s -o %t
-// RUN: ASAN_OPTIONS=fast_unwind_on_fatal=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST
-// RUN: ASAN_OPTIONS=fast_unwind_on_fatal=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW
+// 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
 
 // 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).
index 4499992444f9bebd3fbf3f036d3f5ebc148f36f7..1820cb90c4ef62a4dc28623615fb820a187ae7ec 100644 (file)
@@ -1,10 +1,10 @@
 // Test quarantine_size_mb (and the deprecated quarantine_size)
 // RUN: %clangxx_asan  %s -o %t
-// RUN: ASAN_OPTIONS=quarantine_size=10485760:verbosity=1:hard_rss_limit_mb=50 %run %t  2>&1  | FileCheck %s  --check-prefix=Q10
-// RUN: ASAN_OPTIONS=quarantine_size_mb=10:verbosity=1:hard_rss_limit_mb=50    %run %t  2>&1  | FileCheck %s  --check-prefix=Q10
-// RUN: ASAN_OPTIONS=quarantine_size_mb=10:quarantine_size=20:verbosity=1  not  %run %t  2>&1 | FileCheck %s  --check-prefix=BOTH
-// RUN: ASAN_OPTIONS=quarantine_size_mb=1000:hard_rss_limit_mb=50 not  %run %t           2>&1 | FileCheck %s  --check-prefix=RSS_LIMIT
-// RUN: ASAN_OPTIONS=hard_rss_limit_mb=50                         not  %run %t           2>&1 | FileCheck %s  --check-prefix=RSS_LIMIT
+// 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
 #include <string.h>
 char *g;
 
index 140164464d872888775aa5dac828728d52da27b7..7dc8018b84358602219c77bde1ca61e57cd016d0 100644 (file)
@@ -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: ASAN_OPTIONS=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: ASAN_OPTIONS=new_delete_type_mismatch=1 not %run %t array  2>&1 | FileCheck %s -check-prefix=ARRAY
-// RUN: ASAN_OPTIONS=new_delete_type_mismatch=0     %run %t scalar
-// RUN: ASAN_OPTIONS=new_delete_type_mismatch=0     %run %t array
+// 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:                                                                  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
 
 // FIXME: the following two lines are not true after r232788.
 // Sized-delete is implemented with a weak delete() definition.
index 5f597e9c51f0f64128eac45b5ae04c82455acc5e..23c4d23ce406e4251c481e7e83b5e15a098075ed 100644 (file)
@@ -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=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdio.h>
index b3bd9f7780f5a76d77bef6dd34f4fe27a0efcdda..66b57d44d6ebd7b2ef048125003c04079459c7ed 100644 (file)
@@ -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: ASAN_OPTIONS=exitcode=0 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:exitcode=0 %run %t 2>&1 | FileCheck %s
 // XFAIL: arm-linux-gnueabi
 // XFAIL: armv7l-unknown-linux-gnueabihf
 
index b394908759910b5cb34cd28f372b82b393b9ee46..785228b292388081a8a5adeb34366eb10449326e 100644 (file)
@@ -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: ASAN_OPTIONS=verbosity=2 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 %run %t 2>&1 | FileCheck %s
 
 // CHECK: before
 // CHECK: __tls_get_addr: static tls
index cb901ee59953ae9e3f5769984a245b66cc73eed2..7af33b9457ea04976e3d690bc4c7143a1a6f3b25 100644 (file)
@@ -12,9 +12,9 @@
 // RUN: %clangxx_asan %s -ldl -pthread -o %t
 // RUN: %run %t 0 3
 // RUN: %run %t 2 3
-// RUN: ASAN_OPTIONS=verbosity=2 %run %t 10 2 2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=verbosity=2:intercept_tls_get_addr=1 %run %t 10 2 2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=verbosity=2:intercept_tls_get_addr=0 %run %t 10 2 2>&1 | FileCheck %s --check-prefix=CHECK0
+// 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
 // CHECK: __tls_get_addr
 // CHECK: Creating thread 0
 // CHECK: __tls_get_addr
index b6443fab85dfaf3c575ee43338eca2b5417c1be4..b299ae8cb21e9c1ed53d0f7f4dda0c2599ac2375 100644 (file)
@@ -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=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s
+// 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
 
 #include <signal.h>
 #include <stdio.h>
index 3ce6446eca2208a460a113ab8a8ad7fb9cb09272..043130f9e5495de799b3ab8a6065e03a45b4f50e 100644 (file)
@@ -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=symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s
 // XFAIL: arm-linux-gnueabi
 // XFAIL: armv7l-unknown-linux-gnueabihf
 
index df14e3b329e2a548700df95d26a4eb087075dc93..af73f5d2952d5d892028d1747a2a9cb7268d1595 100644 (file)
@@ -7,11 +7,11 @@
 // 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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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: env ASAN_OPTIONS=$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 %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: ASAN_OPTIONS=start_deactivated=1,coverage=1,coverage_direct=1,verbosity=1 \
+// RUN: env ASAN_OPTIONS=$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 %dynamiclib
 // RUN: cd %T/coverage-direct-activation/direct2
 // RUN: %sancov rawunpack *.sancov.raw
index d37a78cf9a8e1086ba54fbc41d72da3ceef2bf29..2769172c39aba9ad4fc8be91d88aa6e9784530a7 100644 (file)
@@ -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: ASAN_OPTIONS=coverage=1:coverage_direct=0:verbosity=1 %run %t %dynamiclib
+// RUN: env ASAN_OPTIONS=$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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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 ../..
index b621ad53c6ff712411d644ade3f32a297408708e..5371a859c24f1aff4df92b667d620fbe037fc346 100644 (file)
@@ -6,11 +6,11 @@
 // 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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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
 // 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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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
 // 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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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 %dynamiclib
+// RUN: env ASAN_OPTIONS=$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
index 1b53df400b335a00b6a429733ebc0673bf1cd97b..39363911fec3da3f64fcaa1800b405610fa5ea31 100644 (file)
@@ -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=coverage=1:coverage_direct=1:verbosity=1 %run %t; \
+// RUN: (ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_direct=1:verbosity=1 %run %t; \
 // RUN:  %sancov rawunpack *.sancov.raw; %sancov print *.sancov) 2>&1
 //
 // XFAIL: android
index 1f8a1e11d823bcc10e5488c873a2fcf0fde0c54f..c1f0fc3a84b845f3b9d5c3fa74f32fa265064c15 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
-// RUN: export ASAN_OPTIONS=coverage=1:coverage_direct=0:verbosity=1
+// 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
index 3aa6e40e82dfad61da2ec127320a3e73bd91fa37..fe08bdd792b1b810bae9d3073405850c99af388d 100644 (file)
@@ -3,7 +3,7 @@
 // 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=coverage=1:verbosity=1
+// 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
index a7f822dab79962a7895f373ae09e3657794eebd9..dd2c1ec43be58712244d0038727e86c58e344f9f 100644 (file)
@@ -1,6 +1,6 @@
 // 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=coverage=1:verbosity=1
+// 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
index 1ed530c94c172aa4d2282241e1d0de165028dfc8..99e348fdaf9d7586a16e53b97474962d4515280f 100644 (file)
@@ -1,6 +1,6 @@
 // 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=coverage=1:verbosity=1
+// 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: %sancov print `ls coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1
index 78f152fe93fe5e7271245ea2955c39b70bb02425..d25f6ecbee1f1871995612ea983f5245328865f1 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clangxx_asan -O0 -g %s -o %t && ASAN_OPTIONS=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 -g %s -o %t && ASAN_OPTIONS=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s
+// 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 && %run %t
 // RUN: %clangxx_asan -O3 -g %s -o %t && %run %t
index f852a62ea9a303c0a13459564cf423bbd4b32f3c..b1c99430c75d8db86c5f95d44f6711a4f744c76a 100644 (file)
@@ -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: ASAN_OPTIONS=quarantine_size_mb=0 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size_mb=0 %run %t
 
 #include <assert.h>
 #include <string.h>
index cfe90dfb54d37c212b533616e464636eb4d490c1..9f09b78f41c73c6e747660e50a93ee48e56bb833 100644 (file)
@@ -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="log_path=%t.log verbosity=1" not %run %t 2> %t.out
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS: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 ]
 
index 85d51f36183535bc04b97281293dd9e24cc836ac..bc681857ae672e900dbf71150162c08c63dbddf4 100644 (file)
@@ -1,8 +1,8 @@
 // REQUIRES: asan-64-bits
 // RUN: %clangxx_asan -O3 %s -o %t
 // RUN:                                    not %run %t 2>&1  | FileCheck %s
-// RUN: ASAN_OPTIONS=poison_array_cookie=1 not %run %t 2>&1  | FileCheck %s
-// RUN: ASAN_OPTIONS=poison_array_cookie=0 not %run %t 2>&1  | FileCheck %s --check-prefix=NO_COOKIE
+// 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
 #include <stdio.h>
 #include <stdlib.h>
 struct C {
index c35ccebb8c79777505aede26716552efcb8ba231..5998d06756d7c7c6c4c8baf958b4ae6abf7379c0 100644 (file)
@@ -1,7 +1,7 @@
 // REQUIRES: asan-64-bits
 // RUN: %clangxx_asan -O3 %s -o %t
-// RUN: ASAN_OPTIONS=poison_array_cookie=1 not %run %t 2>&1  | FileCheck %s --check-prefix=COOKIE
-// RUN: ASAN_OPTIONS=poison_array_cookie=0 not %run %t 2>&1  | FileCheck %s --check-prefix=NO_COOKIE
+// 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
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
index 2eb02dff6fdb14c23e54067d06a10cc0ab560a87..2ca8015fc742759ba6fea7855bf2ed982700cfe0 100644 (file)
@@ -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: ASAN_OPTIONS=start_deactivated=1,allocator_may_return_null=0 \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=start_deactivated=1 \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:start_deactivated=1 \
 // RUN:   ASAN_ACTIVATION_OPTIONS=help=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-HELP
-// RUN: ASAN_OPTIONS=start_deactivated=1,verbosity=1 \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=start_deactivated=1 \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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: ASAN_OPTIONS=start_deactivated=1 \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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
index 6952245227b49f0a67b85129755084f54a4f5886..69d28194fb9e5e21de0d2fb367757ea5e5dc3c9c 100644 (file)
@@ -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: ASAN_OPTIONS=quarantine_size_mb=0 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:quarantine_size_mb=0 %run %t
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
index 44b499fcb4cdddcb299d81db79e5947f6b93a0ef..63d29a575f2081af7029d7172a7126a313b52351 100644 (file)
@@ -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_OPTIONS=$ASAN_OPTIONS:coverage=1 %run ./test.exe
 //
 // RUN: %sancov print *.sancov | FileCheck %s
 #include <stdio.h>
index fbdb1c145bbebbf8a4a28a12acf9dc106da773af..3fea308d57d6f68905f632a77bcb369045f10420 100644 (file)
@@ -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_OPTIONS=$ASAN_OPTIONS: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.
index 6cd74c265b8ffccee4fc52e64aaa6344161e5599..44e5cbb86498e4983989c32977595bbf3f820c0c 100644 (file)
@@ -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_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s
 
 #include <malloc.h>
 
index 8b050975aac19ee00d4ce3f76a4646d98b947368..c10d2e20f9a180a3d8dd2fc341d5d7efb6002de7 100644 (file)
@@ -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_OPTIONS=$ASAN_OPTIONS:report_globals=1 %run %te.exe %t.dll 2>&1 | FileCheck %s
 
 #include <windows.h>
 #include <stdio.h>
index 72bf36ad0be743ae7bd5a8060827732562ac6024..853804866bb5c7127ea5e1242411397b8ebe8265 100644 (file)
@@ -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_OPTIONS=$ASAN_OPTIONS:report_globals=2 %run %te.exe %t.dll 2>&1 | FileCheck %s
 
 #include <windows.h>
 #include <stdio.h>
index 7955f2685308352828e5e17a85c19d20a9981537..508c0bf58a395c0528196b1b31409e7ccb1dd640 100644 (file)
@@ -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_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
 
 char *x;
 
index da6fbd43099ea93aeaa238f98f179a9f9b94373b..bc6cd2035163be4bf9ec90ec87a1d70417edd565 100644 (file)
@@ -4,16 +4,16 @@
 //
 // RUN: %clangxx_asan -O0 %s -o %t
 // RUN: not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=1     %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=1     %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=1     %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=1     %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH
-// RUN: env ASAN_OPTIONS=allocator_may_return_null=1     %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=1     %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=1     %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=1     %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=1     %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allocator_may_return_null=1     %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL
 
 #include <limits.h>
 #include <stdlib.h>
index 35bdfcb353c2e79647122d51b94d6014469f115c..05de12b66bba09a9745e7b390992c634dabe22c6 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clangxx_asan -coverage -O0 %s -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=1 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=1 %run %t 2>&1 | FileCheck %s
 // XFAIL: android
 #include <stdio.h>
 int foo() { return 1; }
index f10830f160850ce6565477af285ca62bf6887e3b..a5e19e0c20034c34ffa991975db7c6e721986875 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clangxx_asan -O0 %s -o %t
-// RUN: ASAN_OPTIONS=help=1 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:help=1 %run %t 2>&1 | FileCheck %s
 
 int main() {
 }
index be653447524500096e498c8fe1ce8a17c471697e..596bfdaa0d534774aae101b67709a7aa93369ae8 100644 (file)
@@ -1,6 +1,6 @@
 // Make sure we report atexit stats.
 // RUN: %clangxx_asan -O3 %s -o %t
-// RUN: env ASAN_OPTIONS=atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s
 //
 // No atexit output on Android due to
 // https://code.google.com/p/address-sanitizer/issues/detail?id=263
index d60af6fd2d35e08a3e444b382780c3aada468bba..f3739506fb3ac424d17197335bbe9fca346568d2 100644 (file)
@@ -1,14 +1,14 @@
 // Test strict_string_checks option in atoi function
 // RUN: %clang_asan %s -o %t
 // RUN: %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test1 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
 // RUN: %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test2 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
 // RUN: %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test3 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
 
 #include <assert.h>
 #include <stdlib.h>
index 97ec5ba15fd264062ebfdccb254f7639f444f156..f106150f3eaacd38699cbdcf514e7998ff42032b 100644 (file)
@@ -1,14 +1,14 @@
 // Test strict_string_checks option in atol function
 // RUN: %clang_asan %s -o %t
 // RUN: %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test1 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
 // RUN: %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test2 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
 // RUN: %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test3 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
 
 #include <assert.h>
 #include <stdlib.h>
index cd0ef6903f2c21e1fb18b6b0131ec9e389ad2586..23405d2d220d8c7a99aa933d934c0a6b934ccbc3 100644 (file)
@@ -1,14 +1,14 @@
 // Test strict_string_checks option in atoll function
 // RUN: %clang_asan %s -o %t
 // RUN: %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test1 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
 // RUN: %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test2 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
 // RUN: %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test3 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
 
 #include <assert.h>
 #include <stdlib.h>
index 604bf8bcf0a1e2a8f93593e94c0c590cdd8dd798..56799e45a9204bd4371a067845b85397d4d36b23 100644 (file)
@@ -2,7 +2,7 @@
 // symbolizer still works.
 
 // RUN: rm -f %t.log.*
-// RUN: %clangxx_asan -O0 %s -o %t 2>&1 && ASAN_OPTIONS=log_path=%t.log:verbosity=2 not %run %t 2>&1
+// RUN: %clangxx_asan -O0 %s -o %t 2>&1 && ASAN_OPTIONS=$ASAN_OPTIONS:log_path=%t.log:verbosity=2 not %run %t 2>&1
 // RUN: FileCheck %s --check-prefix=CHECK-FILE < %t.log.*
 
 #include <assert.h>
index 9bea17765ea1df7035400212a5ca3fe94b13a568..1ae1ff1643025dc264fb795dd143eb485f0f6e4c 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 // RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
 // RUN: not %run %t bad-alignment 2>&1 | FileCheck --check-prefix=CHECK-BAD-ALIGNMENT %s
-// RUN: env ASAN_OPTIONS=detect_container_overflow=0 %run %t crash
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_container_overflow=0 %run %t crash
 //
 // Test crash due to __sanitizer_annotate_contiguous_container.
 
index b58447d5943e727084fdd0e062acdbe08f4000ac..f65889c0a1bffafc02b7de6b9bd20ca906c69a8d 100644 (file)
@@ -5,7 +5,7 @@
 // RUN: rm -rf %T/coverage-and-lsan
 //
 // RUN: mkdir -p %T/coverage-and-lsan/normal
-// RUN: ASAN_OPTIONS=coverage=1:coverage_dir=%T/coverage-and-lsan:verbosity=1 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_dir=%T/coverage-and-lsan:verbosity=1 not %run %t 2>&1 | FileCheck %s
 // RUN: %sancov print %T/coverage-and-lsan/*.sancov 2>&1
 //
 // REQUIRES: leak-detection
index 154cdcc4eb8024987d42c6ad393fdf6a1999f384..ac6d2486e462463de712868c5ba0085ed8e2b0ad 100644 (file)
@@ -1,7 +1,7 @@
 // Test __sanitizer_get_total_unique_coverage for caller-callee coverage
 
 // RUN: %clangxx_asan -fsanitize-coverage=edge,indirect-calls %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1 %run %t
 // RUN: rm -f caller-callee*.sancov
 //
 // REQUIRES: asan-64-bits
index 2182219c1d1e8afcd213dc8350df634e7f4e61ed..9c42817776f95adcdee808b6b802f8d43bb78b53 100644 (file)
@@ -2,12 +2,12 @@
 // and various numbers of callers and callees.
 
 // RUN: %clangxx_asan -fsanitize-coverage=edge,indirect-calls %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 10 1 2>&1 | FileCheck %s --check-prefix=CHECK-10-1
-// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 9  2 2>&1 | FileCheck %s --check-prefix=CHECK-9-2
-// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 7  3 2>&1 | FileCheck %s --check-prefix=CHECK-7-3
-// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 17 1 2>&1 | FileCheck %s --check-prefix=CHECK-17-1
-// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 15 2 2>&1 | FileCheck %s --check-prefix=CHECK-15-2
-// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 18 3 2>&1 | FileCheck %s --check-prefix=CHECK-18-3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t 10 1 2>&1 | FileCheck %s --check-prefix=CHECK-10-1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t 9  2 2>&1 | FileCheck %s --check-prefix=CHECK-9-2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t 7  3 2>&1 | FileCheck %s --check-prefix=CHECK-7-3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t 17 1 2>&1 | FileCheck %s --check-prefix=CHECK-17-1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t 15 2 2>&1 | FileCheck %s --check-prefix=CHECK-15-2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t 18 3 2>&1 | FileCheck %s --check-prefix=CHECK-18-3
 // RUN: rm -f caller-callee*.sancov
 //
 // REQUIRES: asan-64-bits
index 96b1e73f962a9c07b1ce46f889e2947707c592c1..605bd10d929956b1fa070f5fbc7b88e798fd4daf 100644 (file)
@@ -5,11 +5,11 @@
 // RUN: rm -rf %T/coverage-disabled
 //
 // RUN: mkdir -p %T/coverage-disabled/normal
-// RUN: ASAN_OPTIONS=coverage_direct=0:coverage_dir=%T/coverage-disabled/normal:verbosity=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_direct=0:coverage_dir=%T/coverage-disabled/normal:verbosity=1 %run %t
 // RUN: not %sancov print %T/coverage-disabled/normal/*.sancov 2>&1
 //
 // RUN: mkdir -p %T/coverage-disabled/direct
-// RUN: ASAN_OPTIONS=coverage_direct=1:coverage_dir=%T/coverage-disabled/direct:verbosity=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_direct=1:coverage_dir=%T/coverage-disabled/direct:verbosity=1 %run %t
 // RUN: cd %T/coverage-disabled/direct
 // RUN: not %sancov rawunpack *.sancov
 //
index ef62435ec223f56af7b1d5c6eaa54aa32df026ed..aa3641927cf23b0e08296816ed6bb4d2315517d8 100644 (file)
@@ -1,19 +1,19 @@
 // Test various levels of coverage
 //
 // RUN: %clangxx_asan -O1 -fsanitize-coverage=func  %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
 // RUN: %clangxx_asan -O1 -fsanitize-coverage=bb  %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2
 // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge  %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3
 // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge -mllvm -sanitizer-coverage-block-threshold=0 %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3
 // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge,8bit-counters %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1:coverage_counters=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK_COUNTERS
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_counters=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK_COUNTERS
 
-// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET
-// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET
-// RUN: ASAN_OPTIONS=coverage=1:coverage_pcs=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOPCS
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_pcs=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOPCS
 //
 // REQUIRES: asan-64-bits
 
index 4760c227d34aada0d071125a974ce0c8b139fb92..b261fb0fc775460357e15d2d7432f30b9b57cd98 100644 (file)
@@ -4,8 +4,8 @@
 // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
 // RUN: rm -rf %T/coverage-maybe-open-file
 // RUN: mkdir -p %T/coverage-maybe-open-file && cd %T/coverage-maybe-open-file
-// RUN: ASAN_OPTIONS=coverage=1 %run %t | FileCheck %s --check-prefix=CHECK-success
-// RUN: ASAN_OPTIONS=coverage=0 %run %t | FileCheck %s --check-prefix=CHECK-fail
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1 %run %t | FileCheck %s --check-prefix=CHECK-success
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=0 %run %t | FileCheck %s --check-prefix=CHECK-fail
 // RUN: [ "$(cat test.sancov.packed)" == "test" ]
 // RUN: cd .. && rm -rf %T/coverage-maybe-open-file
 
index eb2b875257c821b88c58d640fa9e939cee940c99..3f56354e44a731d7ae642f1c42301850a8d297b1 100644 (file)
@@ -3,16 +3,16 @@
 // RUN: rm -rf $DIR
 // RUN: mkdir $DIR
 // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
-// RUN: ASAN_OPTIONS=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t
 // RUN: mv $DIR/*sancov $DIR/A
 
-// RUN: ASAN_OPTIONS=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t 1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t 1
 // RUN: mv $DIR/*sancov $DIR/B
 
-// RUN: ASAN_OPTIONS=coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t
 // RUN: mv $DIR/*sancov $DIR/C
 
-// RUN: ASAN_OPTIONS=coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t 1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t 1
 // RUN: mv $DIR/*sancov $DIR/D
 //
 // RUN: (%sancov print $DIR/A; %sancov print $DIR/B; %sancov print $DIR/C; %sancov print $DIR/D) | FileCheck %s
index cab40ea64f304f17d2f03efdfc937b77d2ed26cf..8e025600fda7b0d33ac7de2bb660b93d861f3f0d 100644 (file)
@@ -1,7 +1,7 @@
 // Test __sanitizer_reset_coverage().
 
 // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
-// RUN: ASAN_OPTIONS=coverage=1 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1 %run %t
 
 #include <sanitizer/coverage_interface.h>
 #include <stdio.h>
index 05f7f68a83d64a760a40431126e969bebed3f9f1..21a98515f648d2ec642e0df66b116569b6e9091e 100644 (file)
@@ -4,14 +4,14 @@
 // RUN: rm -rf   %T/coverage-tracing
 // RUN: mkdir %T/coverage-tracing
 // RUN: cd %T/coverage-tracing
-// RUN:  A=x;   ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK1; mv trace-points.*.sancov $A.points
-// RUN:  A=f;   ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points
-// RUN:  A=b;   ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points
-// RUN:  A=bf;  ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points
-// RUN:  A=fb;  ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points
-// RUN:  A=ffb; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points
-// RUN:  A=fff; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points
-// RUN:  A=bbf; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 100 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK301; mv trace-points.*.sancov $A.points
+// RUN:  A=x;   ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK1; mv trace-points.*.sancov $A.points
+// RUN:  A=f;   ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points
+// RUN:  A=b;   ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points
+// RUN:  A=bf;  ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points
+// RUN:  A=fb;  ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points
+// RUN:  A=ffb; ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points
+// RUN:  A=fff; ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 1   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points
+// RUN:  A=bbf; ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:verbosity=1 %run %t $A 100 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK301; mv trace-points.*.sancov $A.points
 // RUN: diff f.points fff.points
 // RUN: diff bf.points fb.points
 // RUN: diff bf.points ffb.points
index b6d5e2a8a80e5bcdf6f6d1d31266c484917ea665..04de9754801219622dd0a7678b09c41c70dc85ff 100644 (file)
@@ -1,6 +1,6 @@
 // Checks that the debugging API returns correct shadow scale and offset.
 // RUN: %clangxx_asan -O %s -o %t
-// RUN: env ASAN_OPTIONS=verbosity=1 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1 %run %t 2>&1 | FileCheck %s
 
 #include <sanitizer/asan_interface.h>
 #include <stdio.h>
index 3ddd3e1404ce034c8d195e294731e03098c75327..ad7e25ce3bd0bd0aac9e36b7c94af9613cfc89a2 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_asan -O0 %s -o %t
-// RUN: env ASAN_OPTIONS=verbosity=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64-V0
-// RUN: env ASAN_OPTIONS=verbosity=2 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64-V0
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=2 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64
 // REQUIRES: powerpc64-supported-target
 
 #include <stdio.h>
index a5b846e3eb75b3524474e30860cdc6c379709aad..0a26a80758c631acaa45a4b2b1fa8f2948b5ce61 100644 (file)
@@ -1,10 +1,10 @@
 // Check that UAR mode can handle very deep recusrion.
-// RUN: export ASAN_OPTIONS=detect_stack_use_after_return=1
+// 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
 
 // Also check that use_sigaltstack+verbosity doesn't crash.
-// RUN: env ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %run %t  | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1:use_sigaltstack=1 %run %t  | FileCheck %s
 #include <stdio.h>
 
 __attribute__((noinline))
index 3e88d697fcef5b639bc164f3fa1cc45f49700196..7b0f56ef3c667595885ce02bfec3af690c65b327 100644 (file)
@@ -1,7 +1,7 @@
 // Check that we can store lots of stack frames if asked to.
 
 // RUN: %clangxx_asan -O0 %s -o %t 2>&1
-// RUN: env ASAN_OPTIONS=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s
 // XFAIL: arm-linux-gnueabi
 // XFAIL: armv7l-unknown-linux-gnueabihf
 #include <stdlib.h>
index f0dd29174849a4aa2b323936b5fb47943a37c643..2966aadff706c077c459cd9dea24173c3f4a217e 100644 (file)
@@ -2,8 +2,8 @@
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX
 
 // Also works if no malloc context is available.
-// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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
 
index 981e3c31327fe754f55f6c46d11e7d268971a784..33f382cb12be205d99bf8e17f77f15e93eda5704 100644 (file)
@@ -1,7 +1,7 @@
 // Check that ASan prints the faulting instruction bytes on
 // dump_instruction_bytes=1
 // RUN: %clangxx_asan  %s -o %t
-// RUN: env ASAN_OPTIONS=dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP
 //
 // REQUIRES: x86_64-supported-target,i386-supported-target
index 4ffa51dd22d386c4b66e17816129303bbecd05f0..3fedd6a68d38d06c9eac21304a4b9789fe7a2c6b 100644 (file)
@@ -1,9 +1,9 @@
 // RUN: %clangxx_asan %s -pthread -o %t
-// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
-// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
 // RUN: %clangxx_asan -O3 %s -pthread -o %t
-// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
-// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
 // REQUIRES: stable-runtime
 
 #include <assert.h>
index 70a1203562bef4f028053e37178d4f20cfbb2248..caecea704966679c77c2a9c04e08393e64ada783 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=print_stats=1 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:print_stats=1 not %run %t 2>&1 | FileCheck %s
 
 // FIXME: Fix this test under GCC.
 // REQUIRES: Clang
index 1f8caea2169008854daa51ce785ae179f90f3fa0..a70dcef14345bbe7b5159591e0f6342d3ce8f512 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: export ASAN_OPTIONS=detect_stack_use_after_return=1
+// RUN: export ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1
 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
 // XFAIL: arm-linux-gnueabi
index e0dac325ce5826c47e94506febcabb2abfd844a7..1beeb33cd8c342e6201c9084ace9fbcdbd0dece7 100644 (file)
@@ -8,7 +8,7 @@
 // We do *not* want to report init-order bug in this case.
 
 // RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cc -o %t
-// RUN: env ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true not %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
 #include <stdlib.h>
index b8bc93e73cf4474a1aba3bc1164bf6829062e106..12362fc440dcc1b52b97122b3170d4ef3db1798f 100644 (file)
@@ -2,7 +2,7 @@
 // called.
 
 // RUN: %clangxx_asan %s %p/Helpers/init-order-pthread-create-extra.cc -pthread -o %t
-// RUN: env ASAN_OPTIONS=strict_init_order=true %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true %run %t
 
 #include <stdio.h>
 #include <pthread.h>
index 8ea6b46c183366ff0d8fb5ccf5f068bb02483ce4..bcdb111b8bfb307fbac7b4c2dd694bafeea0b775 100644 (file)
@@ -3,15 +3,15 @@
 // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   %p/Helpers/initialization-blacklist-extra2.cc \
 // RUN:   -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   %p/Helpers/initialization-blacklist-extra2.cc \
 // RUN:   -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
 // RUN:   %p/Helpers/initialization-blacklist-extra2.cc \
 // RUN:   -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 
 // Function is defined in another TU.
 int readBadGlobal();
index 25c5a1ff23ce5c4defa01f93d2373a3795aecb1f..6257d67c308d5f5c37fbbf075800b6e7c84494a9 100644 (file)
@@ -1,7 +1,7 @@
 // Test to make sure basic initialization order errors are caught.
 
 // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t-INIT-ORDER-EXE
-// RUN: env ASAN_OPTIONS=check_initialization_order=true not %run %t-INIT-ORDER-EXE 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true not %run %t-INIT-ORDER-EXE 2>&1 | FileCheck %s
 
 // Do not test with optimization -- the error may be optimized away.
 
index 644246186e020067f29a77a8519c68afbc01bf86..1188766b6020c16363e958e98d220f8503c709f5 100644 (file)
@@ -5,13 +5,13 @@
 // not dynamic initialization).
 
 // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 
 class Integer {
   private:
index 1249deb425aa7af95a600a84bfcfe3eb20807e4e..3890edf072026b93083ff5e28bd357d6578c554c 100644 (file)
@@ -2,13 +2,13 @@
 // order checking.  If successful, this will just return 0.
 
 // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-nobug-extra.cc -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-nobug-extra.cc -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-nobug-extra.cc -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 // RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-nobug-extra.cc -o %t
-// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1
 
 // Simple access:
 // Make sure that accessing a global in the same TU is safe
index cb545ccc215e0e0d46cd27c62c00f905834830af..c6f7b842a91dd145ae4c80239280c7cf3c156a2c 100644 (file)
@@ -2,8 +2,8 @@
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX
 
 // Also works if no malloc context is available.
-// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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
 
index 7dd1fadda86db7cd47f1dfed3d418aeef5bccdb2..d253a6f50cf3bfa7b965f3b71f6fad68f1b2a31a 100644 (file)
@@ -9,21 +9,21 @@
 
 // Good log_path.
 // RUN: rm -f %t.log.*
-// RUN: env ASAN_OPTIONS=log_path=%t.log not %run %t 2> %t.out
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:log_path=%t.log not %run %t 2> %t.out
 // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.*
 
 // Invalid log_path.
-// RUN: env ASAN_OPTIONS=log_path=/dev/null/INVALID not %run %t 2> %t.out
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:log_path=/dev/null/INVALID not %run %t 2> %t.out
 // RUN: FileCheck %s --check-prefix=CHECK-INVALID < %t.out
 
 // Too long log_path.
-// RUN: env ASAN_OPTIONS=log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` \
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` \
 // RUN:   not %run %t 2> %t.out
 // RUN: FileCheck %s --check-prefix=CHECK-LONG < %t.out
 
 // Run w/o errors should not produce any log.
 // RUN: rm -f %t.log.*
-// RUN: env ASAN_OPTIONS=log_path=%t.log  %run %t ARG ARG ARG
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:log_path=%t.log  %run %t ARG ARG ARG
 // RUN: not cat %t.log.*
 
 // FIXME: log_path is not supported on Windows yet.
index 0d9f31598545c45767504483b1966db1f0324668..91e1bdc5613e2b09406de6ec7bff4a975c0675ca 100644 (file)
@@ -1,9 +1,9 @@
 // RUN: %clangxx_asan -O0 %s -o %t
-// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=malloc_context_size=2 not %run %t 2>&1 | FileCheck %s --check-prefix=TWO
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=1:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=1:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:malloc_context_size=2 not %run %t 2>&1 | FileCheck %s --check-prefix=TWO
 
 int main() {
   char *x = new char[20];
index 5c926803708d16a9fe7ce0b9ba089bd6b27bf322..13a73a719ddd602f53f5d32364e19adb4bfdda42 100644 (file)
@@ -1,8 +1,8 @@
 // Check that we fill malloc-ed memory correctly.
 // RUN: %clangxx_asan %s -o %t
 // RUN: %run %t | FileCheck %s
-// RUN: env ASAN_OPTIONS=max_malloc_fill_size=10:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-10-8
-// RUN: env ASAN_OPTIONS=max_malloc_fill_size=20:malloc_fill_byte=171 %run %t | FileCheck %s --check-prefix=CHECK-20-ab
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:max_malloc_fill_size=10:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-10-8
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:max_malloc_fill_size=20:malloc_fill_byte=171 %run %t | FileCheck %s --check-prefix=CHECK-20-ab
 
 #include <stdio.h>
 int main(int argc, char **argv) {
index 01c25a9f3efc85b411e76dbc80f4305512893bea..c5539bcfb16f3ecb37007d7fde0ef32a64c3d8cf 100644 (file)
@@ -1,8 +1,8 @@
 // Test max_redzone runtime option.
 
-// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=max_redzone=16 %run %t 0 2>&1
+// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:max_redzone=16 %run %t 0 2>&1
 // RUN: %clangxx_asan -O0 %s -o %t && %run %t 1 2>&1
-// RUN: %clangxx_asan -O3 %s -o %t && env ASAN_OPTIONS=max_redzone=16 %run %t 0 2>&1
+// RUN: %clangxx_asan -O3 %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:max_redzone=16 %run %t 0 2>&1
 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 1 2>&1
 
 #include <stdio.h>
index 16b7673dd547fe0ce2e81fa9f1c45eae26182034..a15d0a35e5ec18a7a67abbda08bfd05045e8defe 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=strict_memcmp=0 %run %t
-// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=strict_memcmp=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_memcmp=0 %run %t
+// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_memcmp=1 not %run %t 2>&1 | FileCheck %s
 // Default to strict_memcmp=1.
 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
 
index d4ffb2eac2469169ccf0394a8cb09fcc6da0c8ea..02410525b2d642eba5a8df0222fd4dd9c415e4fa 100644 (file)
@@ -3,10 +3,10 @@
 // RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %run %t 20 16
 // RUN: %run %t 30 1000000
-// RUN: env ASAN_OPTIONS=mmap_limit_mb=300 %run %t 20 16
-// RUN: env ASAN_OPTIONS=mmap_limit_mb=300 %run %t 20 1000000
-// RUN: env ASAN_OPTIONS=mmap_limit_mb=300 not %run %t 500 16 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=mmap_limit_mb=300 not %run %t 500 1000000 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:mmap_limit_mb=300 %run %t 20 16
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:mmap_limit_mb=300 %run %t 20 1000000
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:mmap_limit_mb=300 not %run %t 500 16 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:mmap_limit_mb=300 not %run %t 500 1000000 2>&1 | FileCheck %s
 // XFAIL: arm-linux-gnueabi
 
 #include <assert.h>
index ce9c98b7859ab0bbc51a84ac9f98e80ea3aeba74..8a8921566dbc9a0b012329917787f9acf9bfbd68 100644 (file)
@@ -1,8 +1,8 @@
 // RUN: %clangxx_asan -O0 %s -o %t
 // RUN: not %run %t      2>&1 | FileCheck %s
 // RUN: not %run %t heap 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=poison_partial=0 %run %t
-// RUN: env ASAN_OPTIONS=poison_partial=0 %run %t heap
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:poison_partial=0 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:poison_partial=0 %run %t heap
 #include <string.h>
 char g[21];
 char *x;
index 12dfa261244f5f6659e0393a157394e91a5a1548..675934071252096973e7ede5466250362643b20c 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clangxx_asan -O0 %s -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=SOURCE
-// RUN: env ASAN_OPTIONS=symbolize=false not %run %t 2>&1 | FileCheck %s --check-prefix=MODULE
-// RUN: env ASAN_OPTIONS=print_summary=false not %run %t 2>&1 | FileCheck %s --check-prefix=MISSING
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:symbolize=false not %run %t 2>&1 | FileCheck %s --check-prefix=MODULE
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:print_summary=false not %run %t 2>&1 | FileCheck %s --check-prefix=MISSING
 
 int main() {
   char *x = new char[20];
index 5657083c5865314b60ee805f70d744e7ab747a8e..2df74b67a31a23c4d6c1c7b9ca4d5bd80839b3df 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_asan -O2 %s -o %t
-// RUN: env ASAN_OPTIONS=check_printf=1 %run %t 2>&1 | FileCheck %s
-// RUN: env ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_printf=1 %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_printf=0 %run %t 2>&1 | FileCheck %s
 // RUN: %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
index e9cb47e24c15dc846678f1c7d41518c5470e1273..b3ab961111423e2d0511edb9e99b3e97d5729b21 100644 (file)
@@ -1,9 +1,9 @@
 // RUN: %clang_asan -O2 %s -o %t
 // We need replace_str=0 and replace_intrin=0 to avoid reporting errors in
 // strlen() and memcpy() called by printf().
-// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
-// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
-// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_str=0:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
 
 // FIXME: printf is not intercepted on Windows yet.
 // XFAIL: win32
index d16833d83c6e54f9e04ef57547697277b51c1a06..bc9fece5dd964ed8630d72c6b2a9547b02a76893 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_asan -O2 %s -o %t
-// RUN: env ASAN_OPTIONS=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
-// RUN: env ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
 // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
 
 // FIXME: printf is not intercepted on Windows yet.
index e269211d4871e4ca74d0c5c093342cd29e943a9c..b2a14ff4f25aaf9abf4324293c9bad1e6fd03c36 100644 (file)
@@ -1,8 +1,8 @@
 // RUN: %clang_asan -O2 %s -o %t
 // We need replace_str=0 and replace_intrin=0 to avoid reporting errors in
 // strlen() and memcpy() called by puts().
-// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
-// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
 
 // FIXME: printf is not intercepted on Windows yet.
 // XFAIL: win32
index ac2c1c4b29979418a793b7cc93ea221bd5dc8b09..d4e2a0ab9ccefba12566620e0abbeb663e8c470b 100644 (file)
@@ -1,8 +1,8 @@
 // RUN: %clang_asan -O2 %s -o %t
 // We need replace_intrin=0 to avoid reporting errors in memcpy.
-// RUN: env ASAN_OPTIONS=replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
-// RUN: env ASAN_OPTIONS=replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
-// RUN: env ASAN_OPTIONS=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
 
 // FIXME: printf is not intercepted on Windows yet.
 // XFAIL: win32
index d4bb74730f120a80ff26787bf7a8de48c6d90094..d792c466f97782704012942c7b51532d324ffcc0 100644 (file)
@@ -1,18 +1,18 @@
 // Test ASan detection of stack-overflow condition.
 
-// RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
 
-// RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -DTHREAD -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DTHREAD -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DTHREAD -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DTHREAD -pthread -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
 // RUN: not %run %t 2>&1 | FileCheck %s
 // REQUIRES: stable-runtime
 
index 437c457748c440f60ae2710431cf4c6545f4a357..669e8703b82f5aca446ae00f6e04f52cd009a767 100644 (file)
@@ -1,9 +1,9 @@
-// RUN: export ASAN_OPTIONS=detect_stack_use_after_return=1
+// 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: env ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS: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
 //
index 15ccf34512e25284e5da39955d897ee0b3e3f241..c6f9d193e5032dda3ae4d17af0b195cef632fad7 100644 (file)
@@ -1,9 +1,9 @@
 // Test haystack overflow in strcasestr function
-// RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: %clang_asan %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strstr asan option
 // Disable other interceptors because strlen may be called inside strcasestr
-// RUN: ASAN_OPTIONS=intercept_strstr=false:replace_str=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1
 
 // There's no interceptor for strcasestr on Windows
 // XFAIL: win32
index 97b3aa2846ffedeb76a4b1de48347211bd739858..a4bc6362636e0b2ac2715261a7bcf8686df5d99d 100644 (file)
@@ -1,9 +1,9 @@
 // Test needle overflow in strcasestr function
-// RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: %clang_asan %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strstr asan option
 // Disable other interceptors because strlen may be called inside strcasestr
-// RUN: ASAN_OPTIONS=intercept_strstr=false:replace_str=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1
 
 // There's no interceptor for strcasestr on Windows
 // XFAIL: win32
index 9448bb3d05666ed08f9121f7859de2c13c4f8d41..03c066bb1b9d33335fe2cc97d416506c743a1ea2 100644 (file)
@@ -1,7 +1,7 @@
 // Test strict_string_checks option in strcasestr function
 // RUN: %clang_asan %s -o %t && %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // There's no interceptor for strcasestr on Windows
 // XFAIL: win32
index 806b6827cbfa6a676976f8ad86fef0fe6898f057..8321f5b620f961e9b917ec6f1faa7cfd931ebc37 100644 (file)
@@ -1,11 +1,11 @@
 // Test strict_string_checks option in strcat function
 // RUN: %clang_asan %s -o %t
 // RUN: not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1
-// RUN: ASAN_OPTIONS=strict_string_checks=false not  %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-STRICT --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false not  %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-STRICT --check-prefix=CHECK1
 // RUN: not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2
-// RUN: ASAN_OPTIONS=strict_string_checks=false not  %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false not  %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2
 
 #include <assert.h>
 #include <stdlib.h>
index d0c32f7c8cc9f151906c65ca83b13a1c6225df57..48c1f139583e5be650a1bf648c38bf3b15d02352 100644 (file)
@@ -1,7 +1,7 @@
 // Test strict_string_checks option in strchr function
 // RUN: %clang_asan %s -o %t && %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>
index 6514ab943b9b42e640db90251e8ec75c0a1a91a3..316765e1837163ac1b1fc71a3f65d9111572dee4 100644 (file)
@@ -1,7 +1,7 @@
 // Test strict_string_checks option in strcmp function
 // RUN: %clang_asan %s -o %t && %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>
index 3f2303988ef94f0194b4a0d27bae4538f272e4c4..5a19222e6bba1382b2fecafd1b2a67dfaa1d8353 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strspn asan option
-// RUN: ASAN_OPTIONS=intercept_strspn=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index dd418f1bd4e4a9901c6ef6701a7b24d437cdd00d..288380fd6108fb1edd6536fa2d560b4f7bd6607a 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strcspn asan option
-// RUN: ASAN_OPTIONS=intercept_strspn=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index 384615288bcc281afdb24fadef8fe4ad2d7afb48..7198f9a08723a4287426cdd69c53897f663a97fc 100644 (file)
@@ -1,7 +1,7 @@
 // Test strict_string_checks option in strcspn function
 // RUN: %clang_asan %s -o %t && %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>
index c441eac9259f7fc377234f27b3405e4ef2901551..fc9ebd1691cc4d26b7101da80a64069d20409ac2 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clang_asan -O2 %s -o %t
-// RUN: env ASAN_OPTIONS="strip_path_prefix='%S/'" not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:strip_path_prefix='%S/'" not %run %t 2>&1 | FileCheck %s
 
 #include <stdlib.h>
 int main() {
index 377af966936e6dff64f0da80163b9271bf581897..16de17689d0c940a83cb0c789b632a407dada9d7 100644 (file)
@@ -1,11 +1,11 @@
 // Test strict_string_checks option in strncat function
 // RUN: %clang_asan %s -o %t
 // RUN: not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1
-// RUN: ASAN_OPTIONS=strict_string_checks=false not  %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-STRICT --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false not  %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-STRICT --check-prefix=CHECK1
 // RUN: not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2
-// RUN: ASAN_OPTIONS=strict_string_checks=false not  %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false not  %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2
 
 #include <assert.h>
 #include <stdlib.h>
index 25b32b30970b43450b34110110884747940620c1..bc7b589762966c80fb979ea85aaf5918acd9c9a2 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strpbrk asan option
-// RUN: ASAN_OPTIONS=intercept_strpbrk=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strpbrk=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index 2c92723f8c20e1459933df07aac08128e2e352db..7247622f149e175208323e2df406d8681b80a2cb 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strpbrk asan option
-// RUN: ASAN_OPTIONS=intercept_strpbrk=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strpbrk=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index 1bf48eccba434b5dc7700bf4d3d272501cf0d287..2521e96ba5f0d97eabe20a75cb5db2ea28047143 100644 (file)
@@ -1,7 +1,7 @@
 // Test strict_string_checks option in strpbrk function
 // RUN: %clang_asan %s -o %t && %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>
index f906bc52637e4b5c694801746bb067d3421a96cf..b35d72828517d33ae7ac4a1462e590480037dcb6 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strspn asan option
-// RUN: ASAN_OPTIONS=intercept_strspn=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index d9f831d45eabb0449e55ad915f07c859a063d59f..530d94c16c53c4a154f923dd4845925f9425c441 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_asan %s -o %t && ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // Test intercept_strspn asan option
-// RUN: ASAN_OPTIONS=intercept_strspn=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index d7ab63ccb27394897674e1ad83656dc5aa8b3d84..7df6c0da9ab047352cb5f45772335fd56689d146 100644 (file)
@@ -1,7 +1,7 @@
 // Test strict_str`ing_checks option in strspn function
 // RUN: %clang_asan %s -o %t && %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>
index bd5f21d36c7b02f96e95df5e8c4999d2a7d0d746..1cbe6e9bd07c21810045a69264d08c5986429498 100644 (file)
@@ -3,7 +3,7 @@
 
 // Test intercept_strstr asan option
 // Disable other interceptors because strlen may be called inside strstr
-// RUN: ASAN_OPTIONS=intercept_strstr=false:replace_str=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index 9bf62b0bab7a67364bd63f1d27b0bb13024cea18..4e97d6be7140074be895c71b8b1ab9e482179eb7 100644 (file)
@@ -3,7 +3,7 @@
 
 // Test intercept_strstr asan option
 // Disable other interceptors because strlen may be called inside strstr
-// RUN: ASAN_OPTIONS=intercept_strstr=false:replace_str=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1
 
 #include <assert.h>
 #include <string.h>
index e2e11fe38e069d8ffa189319454e1c5cf7901654..f7eca6aeb90018461bd9c5ccdb937faa94a12cc6 100644 (file)
@@ -1,7 +1,7 @@
 // Test strict_string_checks option in strstr function
 // RUN: %clang_asan %s -o %t && %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>
index ec4d6ae8aada46150fff882052bb180b41d47dc0..fac3b3a5439df1db10b5c78b2fff3081da76d303 100644 (file)
@@ -1,26 +1,26 @@
 // Test strict_string_checks option in strtol function
 // RUN: %clang_asan -DTEST1 %s -o %t
 // RUN: %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test1 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
 // RUN: %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test2 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
 // RUN: %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test3 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
 // RUN: %run %t test4 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test4 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test4 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4
 // RUN: %run %t test5 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test5 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test5 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5
 // RUN: %run %t test6 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test6 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test6 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6
 // RUN: %run %t test7 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test7 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test7 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7
 
 #include <assert.h>
 #include <stdlib.h>
index 1a7f46fadbb0a045c8b90c162832fd0950d1eca2..983da9f7ed30e6a193cab1d6af296bb2a9e02af8 100644 (file)
@@ -1,26 +1,26 @@
 // Test strict_string_checks option in strtoll function
 // RUN: %clang_asan -DTEST1 %s -o %t
 // RUN: %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test1 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test1 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1
 // RUN: %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test2 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test2 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2
 // RUN: %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test3 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test3 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
 // RUN: %run %t test4 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test4 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test4 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4
 // RUN: %run %t test5 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test5 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test5 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5
 // RUN: %run %t test6 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test6 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test6 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6
 // RUN: %run %t test7 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t test7 2>&1
-// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=false %run %t test7 2>&1
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7
 
 #include <assert.h>
 #include <stdlib.h>
index cc69b7a6e2c2707bb80dc868274d896b5d856020..84f0262dc0bc096d9b8381fd96e9c359f1b59c51 100644 (file)
@@ -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: ASAN_OPTIONS="suppressions=supp.txt" \
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS: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: ASAN_OPTIONS="suppressions='/absolute/path'" not %run %t 2>&1 | \
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS: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: ASAN_OPTIONS="suppressions='folder/only/'" not %run %t 2>&1 | \
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='folder/only/'" not %run %t 2>&1 | \
 // RUN:   FileCheck --check-prefix=CHECK-WRONG-FILE-NAME %s
 
 // XFAIL: android
index 0a6c9995827edc076c320b6736d293ed6f4bc66a..fe5419f17938812e17c144635b31f307a1a0d157 100644 (file)
@@ -3,8 +3,8 @@
 // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 
 // RUN: echo "interceptor_via_fun:crash_function" > %t.supp
-// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS="suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
-// RUN: %clangxx_asan -O3 %s -o %t && ASAN_OPTIONS="suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: %clangxx_asan -O3 %s -o %t && ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
 
 // XFAIL: android
 
index 45a14d1a422ab4ce9f2e6edd5e5d124aefa33afb..8bb1f1a92d3b28880e53cdd3cf8b65ed7e5bf3a5 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 
 // RUN: echo "interceptor_name:strlen" > %t.supp
-// RUN: ASAN_OPTIONS="suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
 
 // XFAIL: android
 
index b7fee239b0a3b45639655d184f42dddb55c7592c..52fd609105395b1ff90d6495805fa2eec88a30e2 100644 (file)
@@ -5,7 +5,7 @@
 // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 
 // RUN: echo "interceptor_via_lib:"`basename %dynamiclib` > %t.supp
-// RUN: ASAN_OPTIONS="suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:suppressions='%t.supp'" %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
 
 // XFAIL: android
 
index 0bfe2972955539976d561d0616aaa6f43acbaa24..bdeca434e6c2908762be3d4e08ca9b385374867a 100644 (file)
@@ -1,5 +1,5 @@
 // Test that use-after-return works with exceptions.
-// export ASAN_OPTIONS=detect_stack_use_after_return=1
+// export ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1
 // RUN: %clangxx_asan  -O0 %s -o %t && %run %t
 
 // Clang doesn't support exceptions on Windows yet.
index 3b247ff531b9b1b3a9e80ed24b55c71075898b1f..ecca2c85028fc214c245c0c32dc1e89412bb87c1 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
 //
 // Check that we can disable it
-// RUN: env ASAN_OPTIONS=allow_user_poisoning=0 %run %t
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:allow_user_poisoning=0 %run %t
 
 #include <stdlib.h>
 
index f98a8e6b62e1f0cb2c9e915eea3c4f6c446bac10..e244ee34b10165c6fc38d3bf5c5b46cd1766a2b1 100644 (file)
@@ -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="detect_stack_use_after_return=1" 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
 // XFAIL: *
 
 int main() {
index 910e5283149a5ff1c5de6d2b2baed9f1191658eb..12372ec6807873f46518d6205b4043adfdac5d04 100644 (file)
@@ -2,7 +2,7 @@
 
 // Good log_path.
 // RUN: rm -f %T/asan.log.*
-// RUN: env ASAN_OPTIONS=log_path=%T/asan.log:log_exe_name=1 not %run %T/verbose-log-path_test-binary 2> %t.out
+// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:log_path=%T/asan.log:log_exe_name=1 not %run %T/verbose-log-path_test-binary 2> %t.out
 // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %T/asan.log.verbose-log-path_test-binary.*
 
 // FIXME: only FreeBSD and Linux have verbose log paths now.
index 02406c090424a4f6f7b641aff74245c0ad06fb20..c5164713dbe43795ad23eea8eed721696656c268 100644 (file)
@@ -29,6 +29,9 @@ def push_dynamic_library_lookup_path(config, new_path):
 # Setup config name.
 config.name = 'AddressSanitizer' + config.name_suffix
 
+# Setup default ASAN_OPTIONS
+config.environment['ASAN_OPTIONS'] = 'symbolize_vs_style=false'
+
 # testFormat: The test format to use to interpret tests.
 external_bash = (not sys.platform in ['win32'])
 config.test_format = lit.formats.ShTest(external_bash)