Skip to content

Commit 826fc8a

Browse files
authored
[llvm][lit] Add tsan feature when enabled (#94573)
1 parent 8b18684 commit 826fc8a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

llvm/docs/CommandGuide/lit.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,23 @@ B, C, and D, and a log message for the failing test C:
625625
********************
626626
PASS: D (4 of 4)
627627
628+
DEFAULT FEATURES
629+
~~~~~~~~~~~~~~~~~
630+
631+
For convenience :program:`lit` automatically adds **available_features** for
632+
some common use cases.
633+
634+
:program:`lit` adds a feature based on the operating system being built on, for
635+
example: `system-darwin`, `system-linux`, etc. :program:`lit` also
636+
automatically adds a feature based on the current architecture, for example
637+
`target-x86_64`, `target-aarch64`, etc.
638+
639+
When building with sanitizers enabled, :program:`lit` automatically adds the
640+
short name of the sanitizer, for example: `asan`, `tsan`, etc.
641+
642+
To see the full list of features that can be added, see
643+
*llvm/utils/lit/lit/llvm/config.py*.
644+
628645
LIT EXAMPLE TESTS
629646
~~~~~~~~~~~~~~~~~
630647

llvm/utils/lit/lit/llvm/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def __init__(self, lit_config, config):
131131
features.add("msan")
132132
if "undefined" in sanitizers:
133133
features.add("ubsan")
134+
if "thread" in sanitizers:
135+
features.add("tsan")
134136

135137
have_zlib = getattr(config, "have_zlib", None)
136138
if have_zlib:

0 commit comments

Comments
 (0)