Skip to content

Commit 71fbf9f

Browse files
author
Julian Lettner
committed
[TSan] Fix TSan flag for Swift on Linux testing
For Swift, we turn on `ignore_noninstrumented_modules` and `ignore_interceptors_accesses` even on Linux (where they are usually disabled). We have to account for that when running LLVM-Swift on Linux. rdar://57436887
1 parent fee9a82 commit 71fbf9f

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

compiler-rt/test/sanitizer_common/lit.common.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ if config.host_os == 'Darwin':
3737
default_tool_options += ['abort_on_error=0']
3838
if config.tool_name == "tsan":
3939
default_tool_options += ['ignore_interceptors_accesses=0']
40+
elif config.host_os == 'Linux' and config.tool_name == 'tsan':
41+
# For Swift, the above also applies on Linux.
42+
default_tool_options += ['ignore_interceptors_accesses=0']
4043
elif config.android:
4144
# The same as on Darwin, we default to "abort_on_error=1" which slows down
4245
# testing. Also, all existing tests are using "not" instead of "not --crash"

compiler-rt/test/tsan/Unit/lit.site.cfg.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ config.test_source_root = config.test_exec_root
1515
if config.host_os == 'Darwin':
1616
config.parallelism_group = config.darwin_sanitizer_parallelism_group_func
1717

18+
# For Swift, the following also applies on Linux.
19+
if config.host_os == 'Darwin' or config.host_os == 'Linux':
1820
# On Darwin, we default to ignore_noninstrumented_modules=1, which also
1921
# suppresses some races the tests are supposed to find. See tsan/lit.cfg.
2022
if 'TSAN_OPTIONS' in config.environment:

compiler-rt/test/tsan/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ if config.host_os == 'Darwin':
2424
# On Darwin, we default to `abort_on_error=1`, which would make tests run
2525
# much slower. Let's override this and run lit tests with 'abort_on_error=0'.
2626
default_tsan_opts += ':abort_on_error=0'
27+
28+
# For Swift, the following also applies on Linux.
29+
if config.host_os == 'Darwin' or config.host_os == 'Linux':
2730
# On Darwin, we default to ignore_noninstrumented_modules=1, which also
2831
# suppresses some races the tests are supposed to find. Let's run without this
2932
# setting, but turn it back on for Darwin tests (see Darwin/lit.local.cfg).

0 commit comments

Comments
 (0)