diff options
| author | Kuba Mracek <mracek@apple.com> | 2017-01-24 21:37:50 +0000 |
|---|---|---|
| committer | Kuba Mracek <mracek@apple.com> | 2017-01-24 21:37:50 +0000 |
| commit | e4c1dd2c08586649ebb3ae1e51ad98f0efabaf68 (patch) | |
| tree | a3e1446088e62a07e3bebea028573a53274cd2d6 | |
| parent | 8981f3aacfddca8365ccd4ef41100cc49419ff69 (diff) | |
| download | bcm5719-llvm-e4c1dd2c08586649ebb3ae1e51ad98f0efabaf68.tar.gz bcm5719-llvm-e4c1dd2c08586649ebb3ae1e51ad98f0efabaf68.zip | |
[tsan] Enable ignore_noninstrumented_modules=1 on Darwin by default
TSan recently got the "ignore_noninstrumented_modules" flag, which disables tracking of read and writes that come from noninstrumented modules (via interceptors). This is a way of suppressing false positives coming from system libraries and other noninstrumented code. This patch turns this on by default on Darwin, where it's supposed to replace the previous solution, "ignore_interceptors_accesses", which disables tracking in *all* interceptors. The new approach should re-enable TSan's ability to find races via interceptors on Darwin.
Differential Revision: https://reviews.llvm.org/D29041
llvm-svn: 292981
51 files changed, 66 insertions, 53 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.inc b/compiler-rt/lib/tsan/rtl/tsan_flags.inc index a48545c433b..e9b3e35f07e 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_flags.inc +++ b/compiler-rt/lib/tsan/rtl/tsan_flags.inc @@ -79,7 +79,7 @@ TSAN_FLAG(bool, die_after_fork, true, TSAN_FLAG(const char *, suppressions, "", "Suppressions file name.") TSAN_FLAG(bool, ignore_interceptors_accesses, false, "Ignore reads and writes from all interceptors.") -TSAN_FLAG(bool, ignore_noninstrumented_modules, false, +TSAN_FLAG(bool, ignore_noninstrumented_modules, SANITIZER_MAC ? true : false, "Interceptors should only detect races when called from instrumented " "modules.") TSAN_FLAG(bool, shared_ptr_interceptor, true, diff --git a/compiler-rt/test/tsan/Darwin/dispatch_main.mm b/compiler-rt/test/tsan/Darwin/dispatch_main.mm index 75887547c60..f4c1e44bc6b 100644 --- a/compiler-rt/test/tsan/Darwin/dispatch_main.mm +++ b/compiler-rt/test/tsan/Darwin/dispatch_main.mm @@ -2,7 +2,7 @@ // quits the main thread. // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/dispatch_once_deadlock.mm b/compiler-rt/test/tsan/Darwin/dispatch_once_deadlock.mm index e88cdc0d0da..e109f64a8dc 100644 --- a/compiler-rt/test/tsan/Darwin/dispatch_once_deadlock.mm +++ b/compiler-rt/test/tsan/Darwin/dispatch_once_deadlock.mm @@ -1,7 +1,7 @@ // Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 not %run %t 2>&1 | FileCheck %s +// RUN: not %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> #import <pthread.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-after.mm b/compiler-rt/test/tsan/Darwin/gcd-after.mm index 49b6bc6f71e..4d66c508554 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-after.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-after.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-apply-race.mm b/compiler-rt/test/tsan/Darwin/gcd-apply-race.mm index 028be1ac5b1..a7bf663a9fe 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-apply-race.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-apply-race.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s +// RUN: %deflake %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-apply.mm b/compiler-rt/test/tsan/Darwin/gcd-apply.mm index a7dc3740dc7..d9d256203ae 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-apply.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-apply.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-async-norace.mm b/compiler-rt/test/tsan/Darwin/gcd-async-norace.mm index c7e28b4ce79..83f8c0d6fb5 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-async-norace.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-async-norace.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-async-race.mm b/compiler-rt/test/tsan/Darwin/gcd-async-race.mm index 1002a56b0a1..cb8fb4bf5ec 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-async-race.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-async-race.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s +// RUN: %deflake %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-barrier-race.mm b/compiler-rt/test/tsan/Darwin/gcd-barrier-race.mm index c42eaebded2..c11e147ff7c 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-barrier-race.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-barrier-race.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s +// RUN: %deflake %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-barrier.mm b/compiler-rt/test/tsan/Darwin/gcd-barrier.mm index 6f58cae7d8f..9d4dcb21502 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-barrier.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-barrier.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-blocks.mm b/compiler-rt/test/tsan/Darwin/gcd-blocks.mm index e0082605f24..1aac7e1f2ef 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-blocks.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-blocks.mm @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-data.mm b/compiler-rt/test/tsan/Darwin/gcd-data.mm index a5154dc3598..d451cf5e8ef 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-data.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-data.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-fd.mm b/compiler-rt/test/tsan/Darwin/gcd-fd.mm index 75da9cd4252..838cf20ca98 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-fd.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-fd.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-groups-destructor.mm b/compiler-rt/test/tsan/Darwin/gcd-groups-destructor.mm index 19c2c9bd147..05c65c04b66 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-groups-destructor.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-groups-destructor.mm @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-groups-leave.mm b/compiler-rt/test/tsan/Darwin/gcd-groups-leave.mm index 6ecf85f5ff0..49fd8e2101c 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-groups-leave.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-groups-leave.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-groups-norace.mm b/compiler-rt/test/tsan/Darwin/gcd-groups-norace.mm index 64ec386ca40..e8501692fe8 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-groups-norace.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-groups-norace.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-groups-stress.mm b/compiler-rt/test/tsan/Darwin/gcd-groups-stress.mm index 457d9afd9c9..cfe4deb0a51 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-groups-stress.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-groups-stress.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-io-barrier-race.mm b/compiler-rt/test/tsan/Darwin/gcd-io-barrier-race.mm index fffc19bd16d..137c3b26700 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-io-barrier-race.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-io-barrier-race.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s +// RUN: %deflake %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-io-barrier.mm b/compiler-rt/test/tsan/Darwin/gcd-io-barrier.mm index fe30138f603..af92b03c1c7 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-io-barrier.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-io-barrier.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-io-cleanup.mm b/compiler-rt/test/tsan/Darwin/gcd-io-cleanup.mm index b15fa0dc253..570e37dd04c 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-io-cleanup.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-io-cleanup.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-io-race.mm b/compiler-rt/test/tsan/Darwin/gcd-io-race.mm index 0bec28fdb75..99000fca158 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-io-race.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-io-race.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s +// RUN: %deflake %run %t 2>&1 | FileCheck %s // REQUIRES: disabled diff --git a/compiler-rt/test/tsan/Darwin/gcd-io.mm b/compiler-rt/test/tsan/Darwin/gcd-io.mm index 4a1726dac8c..70ded40417d 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-io.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-io.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-once.mm b/compiler-rt/test/tsan/Darwin/gcd-once.mm index 3e4a5335607..70e588aaf71 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-once.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-once.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-semaphore-norace.mm b/compiler-rt/test/tsan/Darwin/gcd-semaphore-norace.mm index 20bc5724d16..fd5d1465518 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-semaphore-norace.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-semaphore-norace.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-serial-queue-norace.mm b/compiler-rt/test/tsan/Darwin/gcd-serial-queue-norace.mm index 95efbb764c5..8754b618df2 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-serial-queue-norace.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-serial-queue-norace.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-source-cancel.mm b/compiler-rt/test/tsan/Darwin/gcd-source-cancel.mm index 86e1b28a61c..8aa6f106932 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-source-cancel.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-source-cancel.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-source-cancel2.mm b/compiler-rt/test/tsan/Darwin/gcd-source-cancel2.mm index 956fe87298b..92b31d7d0da 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-source-cancel2.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-source-cancel2.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-source-event.mm b/compiler-rt/test/tsan/Darwin/gcd-source-event.mm index e50cb568de1..e707b655100 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-source-event.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-source-event.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-source-event2.mm b/compiler-rt/test/tsan/Darwin/gcd-source-event2.mm index c45d481a002..b10e4741a3f 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-source-event2.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-source-event2.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-source-registration.mm b/compiler-rt/test/tsan/Darwin/gcd-source-registration.mm index db22613edda..d6d339f94db 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-source-registration.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-source-registration.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-source-registration2.mm b/compiler-rt/test/tsan/Darwin/gcd-source-registration2.mm index 4431bc9d689..63657873cae 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-source-registration2.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-source-registration2.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-source-serial.mm b/compiler-rt/test/tsan/Darwin/gcd-source-serial.mm index c0989fcc732..992203074c1 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-source-serial.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-source-serial.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-suspend.mm b/compiler-rt/test/tsan/Darwin/gcd-suspend.mm index 3e8818a2d56..561e7c0b79c 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-suspend.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-suspend.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-sync-norace.mm b/compiler-rt/test/tsan/Darwin/gcd-sync-norace.mm index c683524f73b..18bf9732079 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-sync-norace.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-sync-norace.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-sync-race.mm b/compiler-rt/test/tsan/Darwin/gcd-sync-race.mm index 650faa4e082..b7f3266dc09 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-sync-race.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-sync-race.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s +// RUN: %deflake %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/gcd-target-queue-norace.mm b/compiler-rt/test/tsan/Darwin/gcd-target-queue-norace.mm index 36cb1b9298d..fbfa65806bd 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-target-queue-norace.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-target-queue-norace.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/ignore-noninstrumented.mm b/compiler-rt/test/tsan/Darwin/ignore-noninstrumented.mm index 5e4453102a9..528e07b9a72 100644 --- a/compiler-rt/test/tsan/Darwin/ignore-noninstrumented.mm +++ b/compiler-rt/test/tsan/Darwin/ignore-noninstrumented.mm @@ -3,7 +3,7 @@ // RUN: %clang_tsan %s -o %t -framework Foundation // Check that without the flag, there are false positives. -// RUN: %deflake %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-RACE +// RUN: %env_tsan_opts=ignore_noninstrumented_modules=0 %deflake %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-RACE // With ignore_noninstrumented_modules=1, no races are reported. // RUN: %env_tsan_opts=ignore_noninstrumented_modules=1 %run %t 2>&1 | FileCheck %s diff --git a/compiler-rt/test/tsan/Darwin/ignored-interceptors.mm b/compiler-rt/test/tsan/Darwin/ignored-interceptors.mm index d5131428184..1105132a3cb 100644 --- a/compiler-rt/test/tsan/Darwin/ignored-interceptors.mm +++ b/compiler-rt/test/tsan/Darwin/ignored-interceptors.mm @@ -6,13 +6,13 @@ // RUN: %clang_tsan %s -o %t -framework Foundation // Check that without the flag, there are false positives. -// RUN: %deflake %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-RACE +// RUN: %env_tsan_opts=ignore_noninstrumented_modules=0 %deflake %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-RACE // With ignore_interceptors_accesses=1, no races are reported. -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_tsan_opts=ignore_noninstrumented_modules=0:ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s // With ignore_interceptors_accesses=1, races in user's code are still reported. -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t race 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RACE +// RUN: %env_tsan_opts=ignore_noninstrumented_modules=0:ignore_interceptors_accesses=1 %deflake %run %t race 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RACE #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/libcxx-call-once.mm b/compiler-rt/test/tsan/Darwin/libcxx-call-once.mm index 5388e495c9c..ba4615fa3ab 100644 --- a/compiler-rt/test/tsan/Darwin/libcxx-call-once.mm +++ b/compiler-rt/test/tsan/Darwin/libcxx-call-once.mm @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -framework Foundation -std=c++11 -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/libcxx-future.mm b/compiler-rt/test/tsan/Darwin/libcxx-future.mm index 902f267ecb8..720c2e089b4 100644 --- a/compiler-rt/test/tsan/Darwin/libcxx-future.mm +++ b/compiler-rt/test/tsan/Darwin/libcxx-future.mm @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #include <iostream> #include <future> diff --git a/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-recursive.mm b/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-recursive.mm index eea02dc561e..a9a3a96f2ad 100644 --- a/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-recursive.mm +++ b/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-recursive.mm @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-stress.mm b/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-stress.mm index 7c36729f010..e5cd7edc6bb 100644 --- a/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-stress.mm +++ b/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr-stress.mm @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr.mm b/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr.mm index 6187c438fec..057ff22874c 100644 --- a/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr.mm +++ b/compiler-rt/test/tsan/Darwin/libcxx-shared-ptr.mm @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/lit.local.cfg b/compiler-rt/test/tsan/Darwin/lit.local.cfg index a85dfcd24c0..e74e82dbf47 100644 --- a/compiler-rt/test/tsan/Darwin/lit.local.cfg +++ b/compiler-rt/test/tsan/Darwin/lit.local.cfg @@ -7,3 +7,5 @@ root = getRoot(config) if root.host_os not in ['Darwin']: config.unsupported = True + +config.environment['TSAN_OPTIONS'] += ':ignore_noninstrumented_modules=1' diff --git a/compiler-rt/test/tsan/Darwin/norace-objcxx-run-time.mm b/compiler-rt/test/tsan/Darwin/norace-objcxx-run-time.mm index 0cf729e7f2d..1de431a076c 100644 --- a/compiler-rt/test/tsan/Darwin/norace-objcxx-run-time.mm +++ b/compiler-rt/test/tsan/Darwin/norace-objcxx-run-time.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -lc++ -fobjc-arc -lobjc -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s // Check that we do not report races between: // - Object retain and initialize diff --git a/compiler-rt/test/tsan/Darwin/objc-double-property.mm b/compiler-rt/test/tsan/Darwin/objc-double-property.mm index 51b10f21c9c..c99151d2804 100644 --- a/compiler-rt/test/tsan/Darwin/objc-double-property.mm +++ b/compiler-rt/test/tsan/Darwin/objc-double-property.mm @@ -1,7 +1,7 @@ -// RUN: %clangxx_tsan -O0 %s -o %t -framework Foundation && %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_tsan -O1 %s -o %t -framework Foundation && %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_tsan -O2 %s -o %t -framework Foundation && %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_tsan -O3 %s -o %t -framework Foundation && %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O0 %s -o %t -framework Foundation && %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t -framework Foundation && %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O2 %s -o %t -framework Foundation && %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O3 %s -o %t -framework Foundation && %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/objc-simple.mm b/compiler-rt/test/tsan/Darwin/objc-simple.mm index a8fc3559296..b62d0eb8702 100644 --- a/compiler-rt/test/tsan/Darwin/objc-simple.mm +++ b/compiler-rt/test/tsan/Darwin/objc-simple.mm @@ -1,7 +1,7 @@ // Test that a simple Obj-C program runs and exits without any warnings. // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> diff --git a/compiler-rt/test/tsan/Darwin/xpc-race.mm b/compiler-rt/test/tsan/Darwin/xpc-race.mm index 9141da42e3a..eaef4e06c1f 100644 --- a/compiler-rt/test/tsan/Darwin/xpc-race.mm +++ b/compiler-rt/test/tsan/Darwin/xpc-race.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s +// RUN: %deflake %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> #import <xpc/xpc.h> diff --git a/compiler-rt/test/tsan/Darwin/xpc.mm b/compiler-rt/test/tsan/Darwin/xpc.mm index a939b02ef21..2d6de269b59 100644 --- a/compiler-rt/test/tsan/Darwin/xpc.mm +++ b/compiler-rt/test/tsan/Darwin/xpc.mm @@ -1,5 +1,5 @@ // RUN: %clang_tsan %s -o %t -framework Foundation -// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #import <Foundation/Foundation.h> #import <xpc/xpc.h> diff --git a/compiler-rt/test/tsan/Unit/lit.site.cfg.in b/compiler-rt/test/tsan/Unit/lit.site.cfg.in index a091ffe53ff..40cf096478f 100644 --- a/compiler-rt/test/tsan/Unit/lit.site.cfg.in +++ b/compiler-rt/test/tsan/Unit/lit.site.cfg.in @@ -14,3 +14,10 @@ config.test_source_root = config.test_exec_root if config.host_os == 'Darwin': config.parallelism_group = config.darwin_sanitizer_parallelism_group_func + + # On Darwin, we default to ignore_noninstrumented_modules=1, which also + # suppresses some races the tests are supposed to find. See tsan/lit.cfg. + if 'TSAN_OPTIONS' in config.environment: + config.environment['TSAN_OPTIONS'] += ':ignore_noninstrumented_modules=0' + else: + config.environment['TSAN_OPTIONS'] = 'ignore_noninstrumented_modules=0' diff --git a/compiler-rt/test/tsan/lit.cfg b/compiler-rt/test/tsan/lit.cfg index f9ae539ba10..3c98d1fdca7 100644 --- a/compiler-rt/test/tsan/lit.cfg +++ b/compiler-rt/test/tsan/lit.cfg @@ -24,6 +24,10 @@ 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'. default_tsan_opts += ':abort_on_error=0' + # On Darwin, we default to ignore_noninstrumented_modules=1, which also + # suppresses some races the tests are supposed to find. Let's run without this + # setting, but turn it back on for Darwin tests (see Darwin/lit.local.cfg). + default_tsan_opts += ':ignore_noninstrumented_modules=0' # Platform-specific default TSAN_OPTIONS for lit tests. if default_tsan_opts: |

