[compiler-rt] d08e5d4 - Make lsan TestCases more consistent

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 11:32:28 PDT 2022


Author: Clemens Wasser
Date: 2022-05-09T11:32:15-07:00
New Revision: d08e5d4cc66ad8d3cb9342f263c35e40c0dd6215

URL: https://github.com/llvm/llvm-project/commit/d08e5d4cc66ad8d3cb9342f263c35e40c0dd6215
DIFF: https://github.com/llvm/llvm-project/commit/d08e5d4cc66ad8d3cb9342f263c35e40c0dd6215.diff

LOG: Make lsan TestCases more consistent

Inlining `LSAN_BASE` makes the lsan TestCases more consistent to the other sanitizer TestCases.
It is also needed on Windows: https://reviews.llvm.org/D115103

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D124322

Added: 
    

Modified: 
    compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm
    compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c
    compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c
    compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp
    compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp
    compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp
    compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp
    compiler-rt/test/lsan/TestCases/disabler.c
    compiler-rt/test/lsan/TestCases/disabler.cpp
    compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp
    compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp
    compiler-rt/test/lsan/TestCases/ignore_object.c
    compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp
    compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp
    compiler-rt/test/lsan/TestCases/link_turned_off.cpp
    compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp
    compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp
    compiler-rt/test/lsan/TestCases/pointer_to_self.cpp
    compiler-rt/test/lsan/TestCases/print_suppressions.cpp
    compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp
    compiler-rt/test/lsan/TestCases/register_root_region.cpp
    compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp
    compiler-rt/test/lsan/TestCases/suppressions_default.cpp
    compiler-rt/test/lsan/TestCases/suppressions_file.cpp
    compiler-rt/test/lsan/TestCases/use_after_return.cpp
    compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp
    compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp
    compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
    compiler-rt/test/lsan/TestCases/use_poisoned_asan.cpp
    compiler-rt/test/lsan/TestCases/use_registers.cpp
    compiler-rt/test/lsan/TestCases/use_registers_extra.cpp
    compiler-rt/test/lsan/TestCases/use_stacks.cpp
    compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp
    compiler-rt/test/lsan/TestCases/use_unaligned.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm b/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm
index 606cc9e1cb1eb..1f258eee9b1ea 100644
--- a/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm
+++ b/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm
@@ -1,9 +1,8 @@
 // Test for threads spawned with wqthread_start
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -DDISPATCH_ASYNC -o %t-async -framework Foundation
 // RUN: %clangxx_lsan %s -DDISPATCH_SYNC -o %t-sync -framework Foundation
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t-async 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t-sync 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0" not %run %t-async 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0" not %run %t-sync 2>&1 | FileCheck %s
 
 #include <dispatch/dispatch.h>
 #include <pthread.h>

diff  --git a/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c b/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c
index c26d33dce7d38..00a0ec3b9967f 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c
+++ b/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c
@@ -3,10 +3,9 @@
 // user-installed TSD destructors have finished running (since they may contain
 // additional cleanup tasks). LSan doesn't actually meet that goal 100%, but it
 // makes its best effort.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0"
 // RUN: %clang_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:use_tls=1 %run %t
-// RUN: %env_lsan_opts=$LSAN_BASE:use_tls=0 not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=1" %run %t
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=0" not %run %t 2>&1 | FileCheck %s
 
 // Investigate why it does not fail with use_stack=0
 // UNSUPPORTED: arm-linux || armhf-linux

diff  --git a/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c b/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c
index be36b52fc34f2..6e3a9b349fc4e 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c
+++ b/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c
@@ -1,7 +1,6 @@
 // Regression test. Disabler should not depend on TSD validity.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_tls=1:use_ld_allocations=0"
 // RUN: %clang_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=1:use_ld_allocations=0" %run %t
 
 #include <assert.h>
 #include <pthread.h>

diff  --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp
index 63a7c87f66da1..a860a06fc42dd 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp
+++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp
@@ -4,11 +4,10 @@
 // https://bugs.llvm.org/show_bug.cgi?id=37804
 // XFAIL: glibc-2.27
 
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0:use_ld_allocations=0"
 // RUN: %clangxx %s -DBUILD_DSO -fPIC -shared -o %t-so.so
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_ld_allocations=0:use_tls=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_ld_allocations=0:use_tls=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 // UNSUPPORTED: arm,powerpc,i386-linux && !android
 

diff  --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp
index ecb6dbe4f7640..e75fde243bcb4 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp
+++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp
@@ -1,8 +1,7 @@
 // Test that dynamically allocated thread-specific storage is included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 // Investigate why it does not fail with use_tls=0

diff  --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp
index c4398c56ea0b3..20000a59e3d5a 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp
+++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp
@@ -1,8 +1,7 @@
 // Test that statically allocated thread-specific storage is included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 #include <assert.h>

diff  --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp
index 84cc6c99fcc75..0722b88fd8422 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp
+++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp
@@ -1,8 +1,7 @@
 // Test that statically allocated TLS space is included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 #include <stdio.h>

diff  --git a/compiler-rt/test/lsan/TestCases/disabler.c b/compiler-rt/test/lsan/TestCases/disabler.c
index 3376f7bfb7b42..b50b572a63598 100644
--- a/compiler-rt/test/lsan/TestCases/disabler.c
+++ b/compiler-rt/test/lsan/TestCases/disabler.c
@@ -1,7 +1,6 @@
 // Test for __lsan_disable() / __lsan_enable().
-// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_tls=0"
 // RUN: %clang_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0:use_tls=0 not %run %t 2>&1 | FileCheck %s
 
 // Investigate why it does not fail with use_tls=0
 // UNSUPPORTED: arm-linux || armhf-linux

diff  --git a/compiler-rt/test/lsan/TestCases/disabler.cpp b/compiler-rt/test/lsan/TestCases/disabler.cpp
index 21e508e5314b0..2202cb53bb2a5 100644
--- a/compiler-rt/test/lsan/TestCases/disabler.cpp
+++ b/compiler-rt/test/lsan/TestCases/disabler.cpp
@@ -1,7 +1,6 @@
 // Test for ScopedDisabler.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_tls=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0:use_tls=0 not %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp b/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp
index 3503eb0f6426d..840842a2c2a27 100644
--- a/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp
+++ b/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp
@@ -1,10 +1,9 @@
 // Test for __lsan_do_leak_check(). We test it by making the leak check run
 // before global destructors, which also tests compatibility with HeapChecker's
 // "normal" mode (LSan runs in "strict" mode by default).
-// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck --check-prefix=CHECK-strict %s
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t foo 2>&1 | FileCheck --check-prefix=CHECK-normal %s
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-strict %s
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t foo 2>&1 | FileCheck --check-prefix=CHECK-normal %s
 
 // Investigate why LeakyGlobal leak does show
 // UNSUPPORTED: arm-linux || armhf-linux

diff  --git a/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp b/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp
index cbe592c4f0220..e1ee9ce11833a 100644
--- a/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp
+++ b/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp
@@ -1,8 +1,7 @@
 // A benchmark that executes malloc/free pairs in parallel.
 // Usage: ./a.out number_of_threads total_number_of_allocations
-// RUN: LSAN_BASE="use_ld_allocations=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t 5 1000000 2>&1
+// RUN: %env_lsan_opts=use_ld_allocations=0 %run %t 5 1000000 2>&1
 #include <assert.h>
 #include <pthread.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/ignore_object.c b/compiler-rt/test/lsan/TestCases/ignore_object.c
index e5fc0128cac76..bd329ad2e3566 100644
--- a/compiler-rt/test/lsan/TestCases/ignore_object.c
+++ b/compiler-rt/test/lsan/TestCases/ignore_object.c
@@ -1,7 +1,6 @@
 // Test for __lsan_ignore_object().
-// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_tls=0"
 // RUN: %clang_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0:use_tls=0 not %run %t 2>&1 | FileCheck %s
 
 // Investigate why it does not fail with use_stack=0
 // UNSUPPORTED: arm-linux || armhf-linux

diff  --git a/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp b/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp
index 07095388982c3..cd8ea44428c1b 100644
--- a/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp
+++ b/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp
@@ -1,7 +1,6 @@
 // Test that LargeMmapAllocator's chunks aren't reachable via some internal data structure.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=report_objects=1:use_stacks=0:use_registers=0 not %run %t 2>&1 | FileCheck %s
 
 // For 32 bit LSan it's pretty likely that large chunks are "reachable" from some
 // internal data structures (e.g. Glibc global data).

diff  --git a/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp b/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp
index 8a8ff824566c6..e95040bee1d3d 100644
--- a/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp
+++ b/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp
@@ -1,10 +1,9 @@
 // Test for the leak_check_at_exit flag.
-// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-do
-// RUN: %env_lsan_opts=$LSAN_BASE:"leak_check_at_exit=0" not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do
-// RUN: %env_lsan_opts=$LSAN_BASE:"leak_check_at_exit=0" %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-do
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0:leak_check_at_exit=0 not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0:leak_check_at_exit=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/link_turned_off.cpp b/compiler-rt/test/lsan/TestCases/link_turned_off.cpp
index 7e1b33e7a1c48..d700d7a40cb93 100644
--- a/compiler-rt/test/lsan/TestCases/link_turned_off.cpp
+++ b/compiler-rt/test/lsan/TestCases/link_turned_off.cpp
@@ -1,8 +1,7 @@
 // Test for disabling LSan at link-time.
-// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t foo 2>&1 | FileCheck %s
 //
 // UNSUPPORTED: darwin
 

diff  --git a/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp b/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp
index 8c4970c9b1370..789050e0806b0 100644
--- a/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp
+++ b/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp
@@ -1,8 +1,7 @@
 // Test that lsan handles tls correctly for many threads
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 // On glibc, this requires the range returned by GetTLS to include

diff  --git a/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp b/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp
index cdba0d1781d9a..70f54c0a32b42 100644
--- a/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp
+++ b/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp
@@ -1,8 +1,7 @@
 // Test that lsan handles tls correctly for many threads
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 // Patch r303906 did not fix all the problems.

diff  --git a/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp b/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp
index 62683a21550f6..efb1fd84051b2 100644
--- a/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp
+++ b/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp
@@ -1,8 +1,7 @@
 // Regression test: pointers to self should not confuse LSan into thinking the
 // object is indirectly leaked. Only external pointers count.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/print_suppressions.cpp b/compiler-rt/test/lsan/TestCases/print_suppressions.cpp
index 2fa199d5d96fe..872ce7a95582e 100644
--- a/compiler-rt/test/lsan/TestCases/print_suppressions.cpp
+++ b/compiler-rt/test/lsan/TestCases/print_suppressions.cpp
@@ -1,11 +1,10 @@
 // Print matched suppressions only if print_suppressions=1 AND at least one is
 // matched. Default is print_suppressions=true.
-// RUN: LSAN_BASE="use_registers=0:use_stacks=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:print_suppressions=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print
-// RUN: %env_lsan_opts=$LSAN_BASE:print_suppressions=0 %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-print
+// RUN: %env_lsan_opts=use_registers=0:use_stacks=0:print_suppressions=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print
+// RUN: %env_lsan_opts=use_registers=0:use_stacks=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print
+// RUN: %env_lsan_opts=use_registers=0:use_stacks=0:print_suppressions=0 %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print
+// RUN: %env_lsan_opts=use_registers=0:use_stacks=0 %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-print
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp b/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp
index 85988e2c1c706..b3750625d78cc 100644
--- a/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp
+++ b/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp
@@ -1,8 +1,7 @@
 // Test for on-demand leak checking.
-// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t foo 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t foo 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t 2>&1 | FileCheck %s
 //
 // UNSUPPORTED: darwin
 

diff  --git a/compiler-rt/test/lsan/TestCases/register_root_region.cpp b/compiler-rt/test/lsan/TestCases/register_root_region.cpp
index b73b56b526f8b..52b80783d5889 100644
--- a/compiler-rt/test/lsan/TestCases/register_root_region.cpp
+++ b/compiler-rt/test/lsan/TestCases/register_root_region.cpp
@@ -1,9 +1,8 @@
 // Test for __lsan_(un)register_root_region().
-// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE %run %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:use_root_regions=0 not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t foo 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=use_stacks=0:use_registers=0:use_root_regions=0 not %run %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdio.h>

diff  --git a/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp b/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp
index fa644c6cb4519..11bb4faf19dcf 100644
--- a/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp
+++ b/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp
@@ -1,5 +1,4 @@
 // Test that out-of-scope local variables are ignored by LSan.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=1"
 
 // LSan-in-ASan fails at -O0 on aarch64, because the stack use-after-return
 // instrumentation stashes the argument to `PutPointerOnStaleStack` on the stack
@@ -10,8 +9,8 @@
 // callee-saved register for rematerialization instead.
 // RUN: %clangxx_lsan -O1 %s -o %t
 
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE":exitcode=0" %run %t 2>&1 | FileCheck --check-prefix=CHECK-sanity %s
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1:exitcode=0" %run %t 2>&1 | FileCheck --check-prefix=CHECK-sanity %s
 //
 // x86 passes parameters through stack that may lead to false negatives
 // The same applies to s390x register save areas.

diff  --git a/compiler-rt/test/lsan/TestCases/suppressions_default.cpp b/compiler-rt/test/lsan/TestCases/suppressions_default.cpp
index 9a660e6100d4e..533b3a05f26f1 100644
--- a/compiler-rt/test/lsan/TestCases/suppressions_default.cpp
+++ b/compiler-rt/test/lsan/TestCases/suppressions_default.cpp
@@ -1,6 +1,5 @@
-// RUN: LSAN_BASE="use_registers=0:use_stacks=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=use_registers=0:use_stacks=0 not %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/suppressions_file.cpp b/compiler-rt/test/lsan/TestCases/suppressions_file.cpp
index de419647df609..d74bb47e5f6bb 100644
--- a/compiler-rt/test/lsan/TestCases/suppressions_file.cpp
+++ b/compiler-rt/test/lsan/TestCases/suppressions_file.cpp
@@ -1,18 +1,17 @@
-// RUN: LSAN_BASE="use_registers=0:use_stacks=0"
 // RUN: %clangxx_lsan %s -o %t
 
 // RUN: rm -f %t.supp
 // RUN: touch %t.supp
 // RUN: %push_to_device %t.supp %device_rundir/%t.supp
-// RUN: %env_lsan_opts="$LSAN_BASE:suppressions='%device_rundir/%t.supp'" not %run %t 2>&1 | FileCheck %s --check-prefix=NOSUPP
+// RUN: %env_lsan_opts="use_registers=0:use_stacks=0:suppressions='%device_rundir/%t.supp'" not %run %t 2>&1 | FileCheck %s --check-prefix=NOSUPP
 
 // RUN: echo "leak:*LSanTestLeakingFunc*" > %t.supp
 // RUN: %push_to_device  %t.supp %device_rundir/%t.supp
-// RUN: %env_lsan_opts="$LSAN_BASE:suppressions='%device_rundir/%t.supp'" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="use_registers=0:use_stacks=0:suppressions='%device_rundir/%t.supp'" not %run %t 2>&1 | FileCheck %s
 //
 // RUN: echo "leak:%t" > %t.supp
 // RUN: %push_to_device  %t.supp %device_rundir/%t.supp
-// RUN: %env_lsan_opts="$LSAN_BASE:suppressions='%device_rundir/%t.supp':symbolize=false" %run %t
+// RUN: %env_lsan_opts="use_registers=0:use_stacks=0:suppressions='%device_rundir/%t.supp':symbolize=false" %run %t
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/use_after_return.cpp b/compiler-rt/test/lsan/TestCases/use_after_return.cpp
index 08252eb133e0f..b0adb9ea0eac4 100644
--- a/compiler-rt/test/lsan/TestCases/use_after_return.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_after_return.cpp
@@ -1,10 +1,9 @@
 // Test that fake stack (introduced by ASan's use-after-return mode) is included
 // in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0"
 // RUN: %clangxx_lsan %s -O2 -o %t
-// RUN: ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts=$LSAN_BASE:"use_stacks=1" %run %t 2>&1
-// RUN: ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="" %run %t 2>&1
+// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1
+// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="" %run %t 2>&1
 
 // Investigate why it does not fail with use_stack=0
 // UNSUPPORTED: arm-linux || armhf-linux

diff  --git a/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp b/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp
index 8664618ebcaeb..fe58a2fa8e577 100644
--- a/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp
@@ -1,8 +1,7 @@
 // Test that initialized globals are included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_globals=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_globals=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 #include <stdio.h>

diff  --git a/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp b/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp
index ef8f8e1f389fb..389ef3bf9ce5a 100644
--- a/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp
@@ -1,8 +1,7 @@
 // Test that uninitialized globals are included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_globals=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_globals=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 #include <stdio.h>

diff  --git a/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp b/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
index 4a93d14c5f76a..3d6d140d60911 100644
--- a/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
@@ -1,12 +1,11 @@
 // Test that unused globals are included in the root set.
 // RUN: %clangxx_lsan -O2 %s -DTEST_LIB -c -o %t.o
 // RUN: %clangxx_lsan -O2 %s %t.o -o %t
-// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_globals=1" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak
+// RUN: %env_lsan_opts="use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak
 // RUN: %env_lsan_opts="" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak
 
 // FIXME: This check is not very important and fails on arm7.
-// %env_lsan_opts=$LSAN_BASE:"use_globals=0" not %run %t 2>&1 | FileCheck %s --check-prefixes=LEAK
+// %env_lsan_opts="use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s --check-prefixes=LEAK
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/use_poisoned_asan.cpp b/compiler-rt/test/lsan/TestCases/use_poisoned_asan.cpp
index 780792e957c39..2cc05b5dcf655 100644
--- a/compiler-rt/test/lsan/TestCases/use_poisoned_asan.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_poisoned_asan.cpp
@@ -1,9 +1,8 @@
 // ASan-poisoned memory should be ignored if use_poisoned is false.
 // REQUIRES: asan
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_poisoned=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_poisoned=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_poisoned=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_poisoned=1" %run %t 2>&1
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/lsan/TestCases/use_registers.cpp b/compiler-rt/test/lsan/TestCases/use_registers.cpp
index 358ec580fe1c0..d7852d4e06137 100644
--- a/compiler-rt/test/lsan/TestCases/use_registers.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_registers.cpp
@@ -1,8 +1,7 @@
 // Test that registers of running threads are included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0"
 // RUN: %clangxx_lsan -pthread %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_registers=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_registers=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 #include "sanitizer_common/print_address.h"

diff  --git a/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp b/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp
index 18a959e0b21c6..9308ee9650579 100644
--- a/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp
@@ -1,8 +1,7 @@
 // Test that registers of running threads are included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0"
 // RUN: %clangxx_lsan -pthread %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_registers=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_registers=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 // FIXME: Support more platforms.

diff  --git a/compiler-rt/test/lsan/TestCases/use_stacks.cpp b/compiler-rt/test/lsan/TestCases/use_stacks.cpp
index 855a8e4ed2b1c..f11d7decf430e 100644
--- a/compiler-rt/test/lsan/TestCases/use_stacks.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_stacks.cpp
@@ -1,8 +1,7 @@
 // Test that stack of main thread is included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_stacks=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 #include <stdio.h>

diff  --git a/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp b/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp
index 579dcffb23514..7ddba8802236b 100644
--- a/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp
@@ -1,8 +1,7 @@
 // Test that stacks of non-main threads are included in the root set.
-// RUN: LSAN_BASE="report_objects=1:use_registers=0"
 // RUN: %clangxx_lsan -pthread %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_stacks=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
 
 #include <assert.h>

diff  --git a/compiler-rt/test/lsan/TestCases/use_unaligned.cpp b/compiler-rt/test/lsan/TestCases/use_unaligned.cpp
index 26afc2d8aafc6..48461aa9eb89a 100644
--- a/compiler-rt/test/lsan/TestCases/use_unaligned.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_unaligned.cpp
@@ -1,8 +1,7 @@
 // Test that unaligned pointers are detected correctly.
-// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_unaligned=0" not %run %t 2>&1 | FileCheck %s
-// RUN: %env_lsan_opts=$LSAN_BASE:"use_unaligned=1" %run %t 2>&1
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_unaligned=0" not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_unaligned=1" %run %t 2>&1
 
 #include <stdio.h>
 #include <stdlib.h>


        


More information about the llvm-commits mailing list