From 85220d021878c4627f69752ff1c411d4f08320c0 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 12 Aug 2015 23:50:12 +0000 Subject: [PATCH] Use %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS' Summary: The lit internal shell is used by default on Windows, and it does not support bash variable expansion. Because bash variable expansion interacts with tokenization, it is prohibitively difficult to make the existing lit shell do general shell variable expansion. The most common use of shell variables in the asan tests is to add options to the default set of options set by lit.cfg. We can avoid the need for variable expansion with a substitution that expands to 'env ASAN_OPTIONS='. This has the side benefit of shortening the RUN lines, so it seemed better than implementing limited variable expansion in lit. Reviewers: samsonov, filcab Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11982 llvm-svn: 244839 --- .../test/asan/TestCases/Posix/closed-fds.cc | 2 +- .../TestCases/Posix/coverage-caller-callee.cc | 12 ++++---- .../Posix/coverage-maybe-open-file.cc | 4 +-- .../test/asan/TestCases/Posix/gc-test.cc | 8 +++--- .../Posix/init-order-pthread-create.cc | 2 +- .../asan/TestCases/Posix/stack-overflow.cc | 24 ++++++++-------- .../TestCases/Posix/stack-use-after-return.cc | 6 ++-- .../asan/TestCases/allocator_returns_null.cc | 20 ++++++------- .../TestCases/asan_and_llvm_coverage_test.cc | 2 +- .../test/asan/TestCases/asan_options-help.cc | 2 +- .../test/asan/TestCases/atexit_stats.cc | 2 +- compiler-rt/test/asan/TestCases/atoi_strict.c | 12 ++++---- compiler-rt/test/asan/TestCases/atol_strict.c | 12 ++++---- .../test/asan/TestCases/atoll_strict.c | 12 ++++---- .../TestCases/contiguous_container_crash.cc | 2 +- .../test/asan/TestCases/coverage-and-lsan.cc | 2 +- .../coverage-caller-callee-total-count.cc | 2 +- .../test/asan/TestCases/coverage-disabled.cc | 4 +-- .../test/asan/TestCases/coverage-levels.cc | 16 +++++------ .../test/asan/TestCases/coverage-order-pcs.cc | 8 +++--- .../test/asan/TestCases/coverage-reset.cc | 2 +- .../test/asan/TestCases/coverage-tracing.cc | 16 +++++------ .../test/asan/TestCases/debug_mapping.cc | 2 +- .../asan/TestCases/debug_ppc64_mapping.cc | 4 +-- .../test/asan/TestCases/deep_call_stack.cc | 2 +- .../test/asan/TestCases/deep_stack_uaf.cc | 2 +- .../test/asan/TestCases/double-free.cc | 4 +-- .../asan/TestCases/dump_instruction_bytes.cc | 2 +- .../test/asan/TestCases/heap-overflow.cc | 2 +- .../test/asan/TestCases/init-order-atexit.cc | 2 +- .../TestCases/initialization-blacklist.cc | 6 ++-- .../test/asan/TestCases/initialization-bug.cc | 2 +- .../TestCases/initialization-constexpr.cc | 8 +++--- .../asan/TestCases/initialization-nobug.cc | 8 +++--- .../test/asan/TestCases/invalid-free.cc | 4 +-- .../test/asan/TestCases/log-path_test.cc | 8 +++--- .../asan/TestCases/malloc_context_size.cc | 10 +++---- .../test/asan/TestCases/malloc_fill.cc | 4 +-- .../test/asan/TestCases/max_redzone.cc | 4 +-- .../test/asan/TestCases/memcmp_strict_test.cc | 4 +-- .../test/asan/TestCases/mmap_limit_mb.cc | 8 +++--- .../test/asan/TestCases/poison_partial.cc | 4 +-- .../test/asan/TestCases/print_summary.cc | 4 +-- compiler-rt/test/asan/TestCases/printf-1.c | 4 +-- compiler-rt/test/asan/TestCases/printf-2.c | 6 ++-- compiler-rt/test/asan/TestCases/printf-3.c | 4 +-- compiler-rt/test/asan/TestCases/printf-4.c | 4 +-- compiler-rt/test/asan/TestCases/printf-5.c | 6 ++-- .../test/asan/TestCases/strcasestr-1.c | 4 +-- .../test/asan/TestCases/strcasestr-2.c | 4 +-- .../test/asan/TestCases/strcasestr_strict.c | 4 +-- .../test/asan/TestCases/strcat_strict.c | 8 +++--- .../test/asan/TestCases/strchr_strict.c | 4 +-- .../test/asan/TestCases/strcmp_strict.c | 4 +-- compiler-rt/test/asan/TestCases/strcspn-1.c | 4 +-- compiler-rt/test/asan/TestCases/strcspn-2.c | 4 +-- .../test/asan/TestCases/strcspn_strict.c | 4 +-- .../test/asan/TestCases/strncat_strict.c | 8 +++--- compiler-rt/test/asan/TestCases/strpbrk-1.c | 4 +-- compiler-rt/test/asan/TestCases/strpbrk-2.c | 4 +-- .../test/asan/TestCases/strpbrk_strict.c | 4 +-- compiler-rt/test/asan/TestCases/strspn-1.c | 4 +-- compiler-rt/test/asan/TestCases/strspn-2.c | 4 +-- .../test/asan/TestCases/strspn_strict.c | 4 +-- compiler-rt/test/asan/TestCases/strstr-1.c | 4 +-- compiler-rt/test/asan/TestCases/strstr-2.c | 4 +-- .../test/asan/TestCases/strstr_strict.c | 4 +-- .../test/asan/TestCases/strtol_strict.c | 28 +++++++++---------- .../test/asan/TestCases/strtoll_strict.c | 28 +++++++++---------- .../asan/TestCases/suppressions-function.cc | 4 +-- .../test/asan/TestCases/use-after-poison.cc | 2 +- .../asan/TestCases/verbose-log-path_test.cc | 2 +- compiler-rt/test/asan/lit.cfg | 8 +++++- 73 files changed, 226 insertions(+), 220 deletions(-) diff --git a/compiler-rt/test/asan/TestCases/Posix/closed-fds.cc b/compiler-rt/test/asan/TestCases/Posix/closed-fds.cc index af0ac26743ca7..3bbe3d8e68e14 100644 --- a/compiler-rt/test/asan/TestCases/Posix/closed-fds.cc +++ b/compiler-rt/test/asan/TestCases/Posix/closed-fds.cc @@ -2,7 +2,7 @@ // symbolizer still works. // RUN: rm -f %t.log.* -// 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: %clangxx_asan -O0 %s -o %t 2>&1 && %env_asan_opts=log_path=%t.log:verbosity=2 not %run %t 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-FILE < %t.log.* // FIXME: copy %t.log back from the device and re-enable on Android. diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-caller-callee.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-caller-callee.cc index 9c42817776f95..99cce23c3db48 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-caller-callee.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-caller-callee.cc @@ -2,12 +2,12 @@ // and various numbers of callers and callees. // RUN: %clangxx_asan -fsanitize-coverage=edge,indirect-calls %s -o %t -// 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: %env_asan_opts=coverage=1:verbosity=1 %run %t 10 1 2>&1 | FileCheck %s --check-prefix=CHECK-10-1 +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 9 2 2>&1 | FileCheck %s --check-prefix=CHECK-9-2 +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 7 3 2>&1 | FileCheck %s --check-prefix=CHECK-7-3 +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 17 1 2>&1 | FileCheck %s --check-prefix=CHECK-17-1 +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 15 2 2>&1 | FileCheck %s --check-prefix=CHECK-15-2 +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-maybe-open-file.cc b/compiler-rt/test/asan/TestCases/Posix/coverage-maybe-open-file.cc index b261fb0fc7754..cab3d5770aa5a 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage-maybe-open-file.cc +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-maybe-open-file.cc @@ -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: 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: %env_asan_opts=coverage=1 %run %t | FileCheck %s --check-prefix=CHECK-success +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/Posix/gc-test.cc b/compiler-rt/test/asan/TestCases/Posix/gc-test.cc index 3fedd6a68d38d..56d8c398fc75b 100644 --- a/compiler-rt/test/asan/TestCases/Posix/gc-test.cc +++ b/compiler-rt/test/asan/TestCases/Posix/gc-test.cc @@ -1,9 +1,9 @@ // RUN: %clangxx_asan %s -pthread -o %t -// 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: %env_asan_opts=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 +// RUN: %env_asan_opts=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=$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: %env_asan_opts=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 +// RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 // REQUIRES: stable-runtime #include diff --git a/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc b/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc index 1850432ca0839..19c000fec4359 100644 --- a/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc +++ b/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc @@ -4,7 +4,7 @@ // RUN: %clangxx_asan -c -DCONFIG1 %s -o %t1.o // RUN: %clangxx_asan -c %s -o %t2.o // RUN: %clangxx_asan -pthread %t1.o %t2.o -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:strict_init_order=true %run %t +// RUN: %env_asan_opts=strict_init_order=true %run %t #ifdef CONFIG1 diff --git a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cc b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cc index d792c466f9778..8ef1618624992 100644 --- a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cc +++ b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cc @@ -1,18 +1,18 @@ // Test ASan detection of stack-overflow condition. -// 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 -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -pthread -o %t && %env_asan_opts=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: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=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_opts=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_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: stable-runtime diff --git a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc index 669e8703b82f5..78901509c43f5 100644 --- a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc +++ b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc @@ -3,7 +3,7 @@ // 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=$ASAN_OPTIONS:detect_stack_use_after_return=0 %run %t +// RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t // Regression test for a CHECK failure with small stack size and large frame. // RUN: %clangxx_asan -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s // @@ -12,8 +12,8 @@ // // Test the max_uar_stack_size_log/min_uar_stack_size_log flag. // -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:max_uar_stack_size_log=20:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-20 %s -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:min_uar_stack_size_log=24:max_uar_stack_size_log=24:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s +// RUN: %env_asan_opts=detect_stack_use_after_return=1:max_uar_stack_size_log=20:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-20 %s +// RUN: %env_asan_opts=detect_stack_use_after_return=1:min_uar_stack_size_log=24:max_uar_stack_size_log=24:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s #include #include diff --git a/compiler-rt/test/asan/TestCases/allocator_returns_null.cc b/compiler-rt/test/asan/TestCases/allocator_returns_null.cc index bc6cd2035163b..6a508307ca57a 100644 --- a/compiler-rt/test/asan/TestCases/allocator_returns_null.cc +++ b/compiler-rt/test/asan/TestCases/allocator_returns_null.cc @@ -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=$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 +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL +// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH +// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL #include #include diff --git a/compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cc b/compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cc index 05de12b66bba0..28167c444299d 100644 --- a/compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cc +++ b/compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cc @@ -1,5 +1,5 @@ // RUN: %clangxx_asan -coverage -O0 %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:check_initialization_order=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=check_initialization_order=1 %run %t 2>&1 | FileCheck %s // XFAIL: android #include int foo() { return 1; } diff --git a/compiler-rt/test/asan/TestCases/asan_options-help.cc b/compiler-rt/test/asan/TestCases/asan_options-help.cc index a5e19e0c20034..96a9cd98fc4d3 100644 --- a/compiler-rt/test/asan/TestCases/asan_options-help.cc +++ b/compiler-rt/test/asan/TestCases/asan_options-help.cc @@ -1,5 +1,5 @@ // RUN: %clangxx_asan -O0 %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:help=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=help=1 %run %t 2>&1 | FileCheck %s int main() { } diff --git a/compiler-rt/test/asan/TestCases/atexit_stats.cc b/compiler-rt/test/asan/TestCases/atexit_stats.cc index 596bfdaa0d534..42a3fbf23f556 100644 --- a/compiler-rt/test/asan/TestCases/atexit_stats.cc +++ b/compiler-rt/test/asan/TestCases/atexit_stats.cc @@ -1,6 +1,6 @@ // Make sure we report atexit stats. // RUN: %clangxx_asan -O3 %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/atoi_strict.c b/compiler-rt/test/asan/TestCases/atoi_strict.c index f3739506fb3ac..6081b2ca47438 100644 --- a/compiler-rt/test/asan/TestCases/atoi_strict.c +++ b/compiler-rt/test/asan/TestCases/atoi_strict.c @@ -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: 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: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 #include #include diff --git a/compiler-rt/test/asan/TestCases/atol_strict.c b/compiler-rt/test/asan/TestCases/atol_strict.c index f106150f3eaac..40d05242314d0 100644 --- a/compiler-rt/test/asan/TestCases/atol_strict.c +++ b/compiler-rt/test/asan/TestCases/atol_strict.c @@ -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: 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: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 #include #include diff --git a/compiler-rt/test/asan/TestCases/atoll_strict.c b/compiler-rt/test/asan/TestCases/atoll_strict.c index 23405d2d220d8..b204c97b17580 100644 --- a/compiler-rt/test/asan/TestCases/atoll_strict.c +++ b/compiler-rt/test/asan/TestCases/atoll_strict.c @@ -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: 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: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 #include #include diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cc b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cc index 1ae1ff1643025..5b999c04930ca 100644 --- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cc +++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cc @@ -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=$ASAN_OPTIONS:detect_container_overflow=0 %run %t crash +// RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash // // Test crash due to __sanitizer_annotate_contiguous_container. diff --git a/compiler-rt/test/asan/TestCases/coverage-and-lsan.cc b/compiler-rt/test/asan/TestCases/coverage-and-lsan.cc index f65889c0a1bff..081f493ee80da 100644 --- a/compiler-rt/test/asan/TestCases/coverage-and-lsan.cc +++ b/compiler-rt/test/asan/TestCases/coverage-and-lsan.cc @@ -5,7 +5,7 @@ // RUN: rm -rf %T/coverage-and-lsan // // RUN: mkdir -p %T/coverage-and-lsan/normal -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_dir=%T/coverage-and-lsan:verbosity=1 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/coverage-caller-callee-total-count.cc b/compiler-rt/test/asan/TestCases/coverage-caller-callee-total-count.cc index ac6d2486e4624..2d063ff1f346b 100644 --- a/compiler-rt/test/asan/TestCases/coverage-caller-callee-total-count.cc +++ b/compiler-rt/test/asan/TestCases/coverage-caller-callee-total-count.cc @@ -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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1 %run %t +// RUN: %env_asan_opts=coverage=1 %run %t // RUN: rm -f caller-callee*.sancov // // REQUIRES: asan-64-bits diff --git a/compiler-rt/test/asan/TestCases/coverage-disabled.cc b/compiler-rt/test/asan/TestCases/coverage-disabled.cc index dd28485a6bcf1..306c56b8e10a9 100644 --- a/compiler-rt/test/asan/TestCases/coverage-disabled.cc +++ b/compiler-rt/test/asan/TestCases/coverage-disabled.cc @@ -5,11 +5,11 @@ // RUN: rm -rf %T/coverage-disabled // // RUN: mkdir -p %T/coverage-disabled/normal -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_direct=0:coverage_dir=%T/coverage-disabled/normal:verbosity=1 %run %t +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_direct=1:coverage_dir=%T/coverage-disabled/direct:verbosity=1 %run %t +// RUN: %env_asan_opts=coverage_direct=1:coverage_dir=%T/coverage-disabled/direct:verbosity=1 %run %t // RUN: cd %T/coverage-disabled/direct // RUN: not %sancov rawunpack *.sancov // diff --git a/compiler-rt/test/asan/TestCases/coverage-levels.cc b/compiler-rt/test/asan/TestCases/coverage-levels.cc index aa3641927cf23..effc9cdbd9394 100644 --- a/compiler-rt/test/asan/TestCases/coverage-levels.cc +++ b/compiler-rt/test/asan/TestCases/coverage-levels.cc @@ -1,19 +1,19 @@ // Test various levels of coverage // // RUN: %clangxx_asan -O1 -fsanitize-coverage=func %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 +// RUN: %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1:coverage_counters=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK_COUNTERS +// RUN: %env_asan_opts=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_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 +// RUN: %env_asan_opts=coverage=1:coverage_bitset=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET +// RUN: %env_asan_opts=coverage=1:coverage_pcs=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOPCS // // REQUIRES: asan-64-bits diff --git a/compiler-rt/test/asan/TestCases/coverage-order-pcs.cc b/compiler-rt/test/asan/TestCases/coverage-order-pcs.cc index 3f56354e44a73..4f148d8547da2 100644 --- a/compiler-rt/test/asan/TestCases/coverage-order-pcs.cc +++ b/compiler-rt/test/asan/TestCases/coverage-order-pcs.cc @@ -3,16 +3,16 @@ // RUN: rm -rf $DIR // RUN: mkdir $DIR // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t +// RUN: %env_asan_opts=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t // RUN: mv $DIR/*sancov $DIR/A -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t 1 +// RUN: %env_asan_opts=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t 1 // RUN: mv $DIR/*sancov $DIR/B -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t +// RUN: %env_asan_opts=coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t // RUN: mv $DIR/*sancov $DIR/C -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t 1 +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/coverage-reset.cc b/compiler-rt/test/asan/TestCases/coverage-reset.cc index 8e025600fda7b..5c648cc95e45d 100644 --- a/compiler-rt/test/asan/TestCases/coverage-reset.cc +++ b/compiler-rt/test/asan/TestCases/coverage-reset.cc @@ -1,7 +1,7 @@ // Test __sanitizer_reset_coverage(). // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:coverage=1 %run %t +// RUN: %env_asan_opts=coverage=1 %run %t #include #include diff --git a/compiler-rt/test/asan/TestCases/coverage-tracing.cc b/compiler-rt/test/asan/TestCases/coverage-tracing.cc index 21a98515f648d..b4b68a064f1b3 100644 --- a/compiler-rt/test/asan/TestCases/coverage-tracing.cc +++ b/compiler-rt/test/asan/TestCases/coverage-tracing.cc @@ -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=$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: A=x; %env_asan_opts=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; %env_asan_opts=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; %env_asan_opts=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; %env_asan_opts=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; %env_asan_opts=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; %env_asan_opts=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; %env_asan_opts=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; %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/debug_mapping.cc b/compiler-rt/test/asan/TestCases/debug_mapping.cc index 04de975480121..bd05f6aab3533 100644 --- a/compiler-rt/test/asan/TestCases/debug_mapping.cc +++ b/compiler-rt/test/asan/TestCases/debug_mapping.cc @@ -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=$ASAN_OPTIONS:verbosity=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc b/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc index ad7e25ce3bd0b..753a6364f4ed6 100644 --- a/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc +++ b/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc @@ -1,6 +1,6 @@ // RUN: %clang_asan -O0 %s -o %t -// 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 +// RUN: %env_asan_opts=verbosity=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64-V0 +// RUN: %env_asan_opts=verbosity=2 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64 // REQUIRES: powerpc64-supported-target #include diff --git a/compiler-rt/test/asan/TestCases/deep_call_stack.cc b/compiler-rt/test/asan/TestCases/deep_call_stack.cc index 0a26a80758c63..f6421b8afe60c 100644 --- a/compiler-rt/test/asan/TestCases/deep_call_stack.cc +++ b/compiler-rt/test/asan/TestCases/deep_call_stack.cc @@ -4,7 +4,7 @@ // RUN: (ulimit -s 4096; %run %t) 2>&1 | FileCheck %s // Also check that use_sigaltstack+verbosity doesn't crash. -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1:use_sigaltstack=1 %run %t | FileCheck %s +// RUN: %env_asan_opts=verbosity=1:use_sigaltstack=1 %run %t | FileCheck %s #include __attribute__((noinline)) diff --git a/compiler-rt/test/asan/TestCases/deep_stack_uaf.cc b/compiler-rt/test/asan/TestCases/deep_stack_uaf.cc index 7b0f56ef3c667..95032f2bd4f55 100644 --- a/compiler-rt/test/asan/TestCases/deep_stack_uaf.cc +++ b/compiler-rt/test/asan/TestCases/deep_stack_uaf.cc @@ -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=$ASAN_OPTIONS:malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include diff --git a/compiler-rt/test/asan/TestCases/double-free.cc b/compiler-rt/test/asan/TestCases/double-free.cc index 2966aadff706c..3297b435e38ef 100644 --- a/compiler-rt/test/asan/TestCases/double-free.cc +++ b/compiler-rt/test/asan/TestCases/double-free.cc @@ -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=$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_opts=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc b/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc index 33f382cb12be2..da86a0f9aa483 100644 --- a/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc +++ b/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc @@ -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=$ASAN_OPTIONS:dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/heap-overflow.cc b/compiler-rt/test/asan/TestCases/heap-overflow.cc index caecea7049666..3ddb243b3ecd5 100644 --- a/compiler-rt/test/asan/TestCases/heap-overflow.cc +++ b/compiler-rt/test/asan/TestCases/heap-overflow.cc @@ -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=$ASAN_OPTIONS:print_stats=1 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=print_stats=1 not %run %t 2>&1 | FileCheck %s // FIXME: Fix this test under GCC. // REQUIRES: Clang diff --git a/compiler-rt/test/asan/TestCases/init-order-atexit.cc b/compiler-rt/test/asan/TestCases/init-order-atexit.cc index 1bbc655b17f1f..021b2bd39a4c8 100644 --- a/compiler-rt/test/asan/TestCases/init-order-atexit.cc +++ b/compiler-rt/test/asan/TestCases/init-order-atexit.cc @@ -5,7 +5,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=$ASAN_OPTIONS:strict_init_order=true not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/initialization-blacklist.cc b/compiler-rt/test/asan/TestCases/initialization-blacklist.cc index bcdb111b8bfb3..3a98fc63eeee2 100644 --- a/compiler-rt/test/asan/TestCases/initialization-blacklist.cc +++ b/compiler-rt/test/asan/TestCases/initialization-blacklist.cc @@ -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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // Function is defined in another TU. int readBadGlobal(); diff --git a/compiler-rt/test/asan/TestCases/initialization-bug.cc b/compiler-rt/test/asan/TestCases/initialization-bug.cc index 6257d67c308d5..3ab24dd03ccea 100644 --- a/compiler-rt/test/asan/TestCases/initialization-bug.cc +++ b/compiler-rt/test/asan/TestCases/initialization-bug.cc @@ -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=$ASAN_OPTIONS:check_initialization_order=true not %run %t-INIT-ORDER-EXE 2>&1 | FileCheck %s +// RUN: %env_asan_opts=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. diff --git a/compiler-rt/test/asan/TestCases/initialization-constexpr.cc b/compiler-rt/test/asan/TestCases/initialization-constexpr.cc index 1188766b6020c..53619ea8186c7 100644 --- a/compiler-rt/test/asan/TestCases/initialization-constexpr.cc +++ b/compiler-rt/test/asan/TestCases/initialization-constexpr.cc @@ -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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 class Integer { private: diff --git a/compiler-rt/test/asan/TestCases/initialization-nobug.cc b/compiler-rt/test/asan/TestCases/initialization-nobug.cc index 3890edf072026..783c7894d0027 100644 --- a/compiler-rt/test/asan/TestCases/initialization-nobug.cc +++ b/compiler-rt/test/asan/TestCases/initialization-nobug.cc @@ -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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:check_initialization_order=true %run %t 2>&1 +// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // Simple access: // Make sure that accessing a global in the same TU is safe diff --git a/compiler-rt/test/asan/TestCases/invalid-free.cc b/compiler-rt/test/asan/TestCases/invalid-free.cc index c6f7b842a91dd..dd59f5af32f22 100644 --- a/compiler-rt/test/asan/TestCases/invalid-free.cc +++ b/compiler-rt/test/asan/TestCases/invalid-free.cc @@ -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=$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_opts=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/log-path_test.cc b/compiler-rt/test/asan/TestCases/log-path_test.cc index d253a6f50cf3b..2e60f4a3ace3a 100644 --- a/compiler-rt/test/asan/TestCases/log-path_test.cc +++ b/compiler-rt/test/asan/TestCases/log-path_test.cc @@ -9,21 +9,21 @@ // Good log_path. // RUN: rm -f %t.log.* -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:log_path=%t.log not %run %t 2> %t.out +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:log_path=/dev/null/INVALID not %run %t 2> %t.out +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` \ +// RUN: %env_asan_opts=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=$ASAN_OPTIONS:log_path=%t.log %run %t ARG ARG ARG +// RUN: %env_asan_opts=log_path=%t.log %run %t ARG ARG ARG // RUN: not cat %t.log.* // FIXME: log_path is not supported on Windows yet. diff --git a/compiler-rt/test/asan/TestCases/malloc_context_size.cc b/compiler-rt/test/asan/TestCases/malloc_context_size.cc index 91e1bdc5613e2..c753a3a5d2b59 100644 --- a/compiler-rt/test/asan/TestCases/malloc_context_size.cc +++ b/compiler-rt/test/asan/TestCases/malloc_context_size.cc @@ -1,9 +1,9 @@ // RUN: %clangxx_asan -O0 %s -o %t -// 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 +// RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=malloc_context_size=1:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=malloc_context_size=1:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=malloc_context_size=2 not %run %t 2>&1 | FileCheck %s --check-prefix=TWO int main() { char *x = new char[20]; diff --git a/compiler-rt/test/asan/TestCases/malloc_fill.cc b/compiler-rt/test/asan/TestCases/malloc_fill.cc index 13a73a719ddd6..c897bbbc8cd39 100644 --- a/compiler-rt/test/asan/TestCases/malloc_fill.cc +++ b/compiler-rt/test/asan/TestCases/malloc_fill.cc @@ -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=$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 +// RUN: %env_asan_opts=max_malloc_fill_size=10:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-10-8 +// RUN: %env_asan_opts=max_malloc_fill_size=20:malloc_fill_byte=171 %run %t | FileCheck %s --check-prefix=CHECK-20-ab #include int main(int argc, char **argv) { diff --git a/compiler-rt/test/asan/TestCases/max_redzone.cc b/compiler-rt/test/asan/TestCases/max_redzone.cc index c5539bcfb16f3..e2a0a2bdec2ff 100644 --- a/compiler-rt/test/asan/TestCases/max_redzone.cc +++ b/compiler-rt/test/asan/TestCases/max_redzone.cc @@ -1,8 +1,8 @@ // Test max_redzone runtime option. -// 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 && %env_asan_opts=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=$ASAN_OPTIONS:max_redzone=16 %run %t 0 2>&1 +// RUN: %clangxx_asan -O3 %s -o %t && %env_asan_opts=max_redzone=16 %run %t 0 2>&1 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 1 2>&1 #include diff --git a/compiler-rt/test/asan/TestCases/memcmp_strict_test.cc b/compiler-rt/test/asan/TestCases/memcmp_strict_test.cc index a15d0a35e5ec1..61ffe8b03e5e9 100644 --- a/compiler-rt/test/asan/TestCases/memcmp_strict_test.cc +++ b/compiler-rt/test/asan/TestCases/memcmp_strict_test.cc @@ -1,5 +1,5 @@ -// 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 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=strict_memcmp=0 %run %t +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/mmap_limit_mb.cc b/compiler-rt/test/asan/TestCases/mmap_limit_mb.cc index 02410525b2d64..07473890c15c9 100644 --- a/compiler-rt/test/asan/TestCases/mmap_limit_mb.cc +++ b/compiler-rt/test/asan/TestCases/mmap_limit_mb.cc @@ -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=$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 +// RUN: %env_asan_opts=mmap_limit_mb=300 %run %t 20 16 +// RUN: %env_asan_opts=mmap_limit_mb=300 %run %t 20 1000000 +// RUN: %env_asan_opts=mmap_limit_mb=300 not %run %t 500 16 2>&1 | FileCheck %s +// RUN: %env_asan_opts=mmap_limit_mb=300 not %run %t 500 1000000 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi #include diff --git a/compiler-rt/test/asan/TestCases/poison_partial.cc b/compiler-rt/test/asan/TestCases/poison_partial.cc index 8a8921566dbc9..3a1b4199945ed 100644 --- a/compiler-rt/test/asan/TestCases/poison_partial.cc +++ b/compiler-rt/test/asan/TestCases/poison_partial.cc @@ -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=$ASAN_OPTIONS:poison_partial=0 %run %t -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:poison_partial=0 %run %t heap +// RUN: %env_asan_opts=poison_partial=0 %run %t +// RUN: %env_asan_opts=poison_partial=0 %run %t heap #include char g[21]; char *x; diff --git a/compiler-rt/test/asan/TestCases/print_summary.cc b/compiler-rt/test/asan/TestCases/print_summary.cc index 6759340712520..3983ebc685706 100644 --- a/compiler-rt/test/asan/TestCases/print_summary.cc +++ b/compiler-rt/test/asan/TestCases/print_summary.cc @@ -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=$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 +// RUN: %env_asan_opts=symbolize=false not %run %t 2>&1 | FileCheck %s --check-prefix=MODULE +// RUN: %env_asan_opts=print_summary=false not %run %t 2>&1 | FileCheck %s --check-prefix=MISSING int main() { char *x = new char[20]; diff --git a/compiler-rt/test/asan/TestCases/printf-1.c b/compiler-rt/test/asan/TestCases/printf-1.c index 2df74b67a31a2..fd009d1d4fe84 100644 --- a/compiler-rt/test/asan/TestCases/printf-1.c +++ b/compiler-rt/test/asan/TestCases/printf-1.c @@ -1,6 +1,6 @@ // RUN: %clang_asan -O2 %s -o %t -// 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: %env_asan_opts=check_printf=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck %s // RUN: %run %t 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/asan/TestCases/printf-2.c b/compiler-rt/test/asan/TestCases/printf-2.c index b3ab961111423..4b5ae138dfffc 100644 --- a/compiler-rt/test/asan/TestCases/printf-2.c +++ b/compiler-rt/test/asan/TestCases/printf-2.c @@ -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=$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 +// RUN: %env_asan_opts=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s +// RUN: %env_asan_opts=replace_str=0:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/printf-3.c b/compiler-rt/test/asan/TestCases/printf-3.c index bc9fece5dd964..267f02d26152f 100644 --- a/compiler-rt/test/asan/TestCases/printf-3.c +++ b/compiler-rt/test/asan/TestCases/printf-3.c @@ -1,6 +1,6 @@ // RUN: %clang_asan -O2 %s -o %t -// 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: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s +// RUN: %env_asan_opts=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. diff --git a/compiler-rt/test/asan/TestCases/printf-4.c b/compiler-rt/test/asan/TestCases/printf-4.c index b2a14ff4f25aa..13bfc876c36ce 100644 --- a/compiler-rt/test/asan/TestCases/printf-4.c +++ b/compiler-rt/test/asan/TestCases/printf-4.c @@ -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=$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 +// RUN: %env_asan_opts=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s +// RUN: %env_asan_opts=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 diff --git a/compiler-rt/test/asan/TestCases/printf-5.c b/compiler-rt/test/asan/TestCases/printf-5.c index d4e2a0ab9ccef..a614462d2f4ad 100644 --- a/compiler-rt/test/asan/TestCases/printf-5.c +++ b/compiler-rt/test/asan/TestCases/printf-5.c @@ -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=$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 +// RUN: %env_asan_opts=replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s +// RUN: %env_asan_opts=replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s +// RUN: %env_asan_opts=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: printf is not intercepted on Windows yet. // XFAIL: win32 diff --git a/compiler-rt/test/asan/TestCases/strcasestr-1.c b/compiler-rt/test/asan/TestCases/strcasestr-1.c index c6f9d193e5032..78e14d31f2780 100644 --- a/compiler-rt/test/asan/TestCases/strcasestr-1.c +++ b/compiler-rt/test/asan/TestCases/strcasestr-1.c @@ -1,9 +1,9 @@ // Test haystack overflow in strcasestr function -// RUN: %clang_asan %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1 // There's no interceptor for strcasestr on Windows // XFAIL: win32 diff --git a/compiler-rt/test/asan/TestCases/strcasestr-2.c b/compiler-rt/test/asan/TestCases/strcasestr-2.c index a4bc6362636e0..4593a143e8fb6 100644 --- a/compiler-rt/test/asan/TestCases/strcasestr-2.c +++ b/compiler-rt/test/asan/TestCases/strcasestr-2.c @@ -1,9 +1,9 @@ // Test needle overflow in strcasestr function -// RUN: %clang_asan %s -o %t && ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=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: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1 // There's no interceptor for strcasestr on Windows // XFAIL: win32 diff --git a/compiler-rt/test/asan/TestCases/strcasestr_strict.c b/compiler-rt/test/asan/TestCases/strcasestr_strict.c index 03c066bb1b9d3..956bee71a3907 100644 --- a/compiler-rt/test/asan/TestCases/strcasestr_strict.c +++ b/compiler-rt/test/asan/TestCases/strcasestr_strict.c @@ -1,7 +1,7 @@ // Test strict_string_checks option in strcasestr function // RUN: %clang_asan %s -o %t && %run %t 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // There's no interceptor for strcasestr on Windows // XFAIL: win32 diff --git a/compiler-rt/test/asan/TestCases/strcat_strict.c b/compiler-rt/test/asan/TestCases/strcat_strict.c index 8321f5b620f96..6e9bd8eb08602 100644 --- a/compiler-rt/test/asan/TestCases/strcat_strict.c +++ b/compiler-rt/test/asan/TestCases/strcat_strict.c @@ -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: 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: %env_asan_opts=strict_string_checks=false not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1 +// RUN: %env_asan_opts=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: 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 +// RUN: %env_asan_opts=strict_string_checks=false not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2 #include #include diff --git a/compiler-rt/test/asan/TestCases/strchr_strict.c b/compiler-rt/test/asan/TestCases/strchr_strict.c index 48c1f139583e5..b2dbaa5b97209 100644 --- a/compiler-rt/test/asan/TestCases/strchr_strict.c +++ b/compiler-rt/test/asan/TestCases/strchr_strict.c @@ -1,7 +1,7 @@ // Test strict_string_checks option in strchr function // RUN: %clang_asan %s -o %t && %run %t 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/strcmp_strict.c b/compiler-rt/test/asan/TestCases/strcmp_strict.c index 316765e183716..e168923749ce2 100644 --- a/compiler-rt/test/asan/TestCases/strcmp_strict.c +++ b/compiler-rt/test/asan/TestCases/strcmp_strict.c @@ -1,7 +1,7 @@ // Test strict_string_checks option in strcmp function // RUN: %clang_asan %s -o %t && %run %t 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/strcspn-1.c b/compiler-rt/test/asan/TestCases/strcspn-1.c index ef02a049530a1..04675e4b420e4 100644 --- a/compiler-rt/test/asan/TestCases/strcspn-1.c +++ b/compiler-rt/test/asan/TestCases/strcspn-1.c @@ -1,8 +1,8 @@ // Test string s1 overflow in strcspn function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strspn asan option -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strcspn-2.c b/compiler-rt/test/asan/TestCases/strcspn-2.c index aa82aa60abfe2..e77ce6502244e 100644 --- a/compiler-rt/test/asan/TestCases/strcspn-2.c +++ b/compiler-rt/test/asan/TestCases/strcspn-2.c @@ -1,8 +1,8 @@ // Test stopset overflow in strcspn function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strcspn asan option -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strcspn_strict.c b/compiler-rt/test/asan/TestCases/strcspn_strict.c index 7198f9a08723a..e7c1e6a769221 100644 --- a/compiler-rt/test/asan/TestCases/strcspn_strict.c +++ b/compiler-rt/test/asan/TestCases/strcspn_strict.c @@ -1,7 +1,7 @@ // Test strict_string_checks option in strcspn function // RUN: %clang_asan %s -o %t && %run %t 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/strncat_strict.c b/compiler-rt/test/asan/TestCases/strncat_strict.c index 16de17689d0c9..2b44b565a5e4f 100644 --- a/compiler-rt/test/asan/TestCases/strncat_strict.c +++ b/compiler-rt/test/asan/TestCases/strncat_strict.c @@ -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: 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: %env_asan_opts=strict_string_checks=false not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1 +// RUN: %env_asan_opts=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: 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 +// RUN: %env_asan_opts=strict_string_checks=false not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2 #include #include diff --git a/compiler-rt/test/asan/TestCases/strpbrk-1.c b/compiler-rt/test/asan/TestCases/strpbrk-1.c index 7cd45bd0979a2..b7a784d993969 100644 --- a/compiler-rt/test/asan/TestCases/strpbrk-1.c +++ b/compiler-rt/test/asan/TestCases/strpbrk-1.c @@ -1,8 +1,8 @@ // Test string s1 overflow in strpbrk function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strpbrk asan option -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strpbrk=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strpbrk=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strpbrk-2.c b/compiler-rt/test/asan/TestCases/strpbrk-2.c index 0d50c002a21a0..748662be738b7 100644 --- a/compiler-rt/test/asan/TestCases/strpbrk-2.c +++ b/compiler-rt/test/asan/TestCases/strpbrk-2.c @@ -1,8 +1,8 @@ // Test stopset overflow in strpbrk function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strpbrk asan option -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strpbrk=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strpbrk=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strpbrk_strict.c b/compiler-rt/test/asan/TestCases/strpbrk_strict.c index 2521e96ba5f0d..131886ea47ec9 100644 --- a/compiler-rt/test/asan/TestCases/strpbrk_strict.c +++ b/compiler-rt/test/asan/TestCases/strpbrk_strict.c @@ -1,7 +1,7 @@ // Test strict_string_checks option in strpbrk function // RUN: %clang_asan %s -o %t && %run %t 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/strspn-1.c b/compiler-rt/test/asan/TestCases/strspn-1.c index 24d0d2daac1eb..c15869d904386 100644 --- a/compiler-rt/test/asan/TestCases/strspn-1.c +++ b/compiler-rt/test/asan/TestCases/strspn-1.c @@ -1,8 +1,8 @@ // Test string s1 overflow in strspn function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strspn asan option -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strspn-2.c b/compiler-rt/test/asan/TestCases/strspn-2.c index e4621e5bfedec..57b3e6cd9473f 100644 --- a/compiler-rt/test/asan/TestCases/strspn-2.c +++ b/compiler-rt/test/asan/TestCases/strspn-2.c @@ -1,8 +1,8 @@ // Test stopset overflow in strspn function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strspn asan option -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strspn=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strspn_strict.c b/compiler-rt/test/asan/TestCases/strspn_strict.c index 7df6c0da9ab04..eee1925a2ee7b 100644 --- a/compiler-rt/test/asan/TestCases/strspn_strict.c +++ b/compiler-rt/test/asan/TestCases/strspn_strict.c @@ -1,7 +1,7 @@ // Test strict_str`ing_checks option in strspn function // RUN: %clang_asan %s -o %t && %run %t 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/strstr-1.c b/compiler-rt/test/asan/TestCases/strstr-1.c index 193334e9bb34c..842e1737e0ca9 100644 --- a/compiler-rt/test/asan/TestCases/strstr-1.c +++ b/compiler-rt/test/asan/TestCases/strstr-1.c @@ -1,9 +1,9 @@ // Test haystack overflow in strstr function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=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 strstr -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strstr-2.c b/compiler-rt/test/asan/TestCases/strstr-2.c index cd116212fa950..77d7cc52a44b1 100644 --- a/compiler-rt/test/asan/TestCases/strstr-2.c +++ b/compiler-rt/test/asan/TestCases/strstr-2.c @@ -1,9 +1,9 @@ // Test needle overflow in strstr function -// RUN: %clang_asan %s -o %t && env ASAN_OPTIONS=$ASAN_OPTIONS:strict_string_checks=true not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan %s -o %t && %env_asan_opts=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 strstr -// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:intercept_strstr=false:replace_str=false %run %t 2>&1 +// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1 #include #include diff --git a/compiler-rt/test/asan/TestCases/strstr_strict.c b/compiler-rt/test/asan/TestCases/strstr_strict.c index f7eca6aeb9001..35ad93c645ded 100644 --- a/compiler-rt/test/asan/TestCases/strstr_strict.c +++ b/compiler-rt/test/asan/TestCases/strstr_strict.c @@ -1,7 +1,7 @@ // Test strict_string_checks option in strstr function // RUN: %clang_asan %s -o %t && %run %t 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/asan/TestCases/strtol_strict.c b/compiler-rt/test/asan/TestCases/strtol_strict.c index fac3b3a5439df..0e9aca00d7201 100644 --- a/compiler-rt/test/asan/TestCases/strtol_strict.c +++ b/compiler-rt/test/asan/TestCases/strtol_strict.c @@ -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: 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: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: %run %t test4 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test4 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4 // RUN: %run %t test5 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test5 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5 // RUN: %run %t test6 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test6 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6 // RUN: %run %t test7 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t test7 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7 #include #include diff --git a/compiler-rt/test/asan/TestCases/strtoll_strict.c b/compiler-rt/test/asan/TestCases/strtoll_strict.c index 983da9f7ed30e..7f745ea2fb1b9 100644 --- a/compiler-rt/test/asan/TestCases/strtoll_strict.c +++ b/compiler-rt/test/asan/TestCases/strtoll_strict.c @@ -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: 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: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: %run %t test4 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test4 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4 // RUN: %run %t test5 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test5 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5 // RUN: %run %t test6 2>&1 -// 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: %env_asan_opts=strict_string_checks=false %run %t test6 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6 // RUN: %run %t test7 2>&1 -// 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 +// RUN: %env_asan_opts=strict_string_checks=false %run %t test7 2>&1 +// RUN: %env_asan_opts=strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7 #include #include diff --git a/compiler-rt/test/asan/TestCases/suppressions-function.cc b/compiler-rt/test/asan/TestCases/suppressions-function.cc index fe5419f179388..802f7baf5cf98 100644 --- a/compiler-rt/test/asan/TestCases/suppressions-function.cc +++ b/compiler-rt/test/asan/TestCases/suppressions-function.cc @@ -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="$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 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=suppressions='%t.supp' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s +// RUN: %clangxx_asan -O3 %s -o %t && %env_asan_opts=suppressions='%t.supp' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // XFAIL: android diff --git a/compiler-rt/test/asan/TestCases/use-after-poison.cc b/compiler-rt/test/asan/TestCases/use-after-poison.cc index ecca2c85028fc..9df042b601516 100644 --- a/compiler-rt/test/asan/TestCases/use-after-poison.cc +++ b/compiler-rt/test/asan/TestCases/use-after-poison.cc @@ -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=$ASAN_OPTIONS:allow_user_poisoning=0 %run %t +// RUN: %env_asan_opts=allow_user_poisoning=0 %run %t #include diff --git a/compiler-rt/test/asan/TestCases/verbose-log-path_test.cc b/compiler-rt/test/asan/TestCases/verbose-log-path_test.cc index 12372ec680787..ba1461f6118fa 100644 --- a/compiler-rt/test/asan/TestCases/verbose-log-path_test.cc +++ b/compiler-rt/test/asan/TestCases/verbose-log-path_test.cc @@ -2,7 +2,7 @@ // Good log_path. // RUN: rm -f %T/asan.log.* -// 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: %env_asan_opts=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. diff --git a/compiler-rt/test/asan/lit.cfg b/compiler-rt/test/asan/lit.cfg index 028f5f89b056e..47db17916935e 100644 --- a/compiler-rt/test/asan/lit.cfg +++ b/compiler-rt/test/asan/lit.cfg @@ -30,10 +30,16 @@ def push_dynamic_library_lookup_path(config, new_path): config.name = 'AddressSanitizer' + config.name_suffix # Platform-specific default ASAN_OPTIONS for lit tests. +default_asan_opts = '' if config.host_os == 'Darwin': # On Darwin, we default to `abort_on_error=1`, which would make tests run # much slower. Let's override this and run lit tests with 'abort_on_error=0'. - config.environment['ASAN_OPTIONS'] = 'abort_on_error=0' + default_asan_opts = 'abort_on_error=0' +if default_asan_opts: + config.environment['ASAN_OPTIONS'] = default_asan_opts + default_asan_opts += ':' +config.substitutions.append(('%env_asan_opts=', + 'env ASAN_OPTIONS=' + default_asan_opts)) # Setup source root. config.test_source_root = os.path.dirname(__file__)