[llvm] 826fc8a - [llvm][lit] Add tsan feature when enabled (#94573)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 16:00:31 PDT 2024
Author: Keith Smiley
Date: 2024-06-11T16:00:27-07:00
New Revision: 826fc8a1acaaeb229d2a422da417ab5d62011e3e
URL: https://github.com/llvm/llvm-project/commit/826fc8a1acaaeb229d2a422da417ab5d62011e3e
DIFF: https://github.com/llvm/llvm-project/commit/826fc8a1acaaeb229d2a422da417ab5d62011e3e.diff
LOG: [llvm][lit] Add tsan feature when enabled (#94573)
Added:
Modified:
llvm/docs/CommandGuide/lit.rst
llvm/utils/lit/lit/llvm/config.py
Removed:
################################################################################
diff --git a/llvm/docs/CommandGuide/lit.rst b/llvm/docs/CommandGuide/lit.rst
index 5e2443cb612a4..799ee34e9f9ff 100644
--- a/llvm/docs/CommandGuide/lit.rst
+++ b/llvm/docs/CommandGuide/lit.rst
@@ -625,6 +625,23 @@ B, C, and D, and a log message for the failing test C:
********************
PASS: D (4 of 4)
+DEFAULT FEATURES
+~~~~~~~~~~~~~~~~~
+
+For convenience :program:`lit` automatically adds **available_features** for
+some common use cases.
+
+:program:`lit` adds a feature based on the operating system being built on, for
+example: `system-darwin`, `system-linux`, etc. :program:`lit` also
+automatically adds a feature based on the current architecture, for example
+`target-x86_64`, `target-aarch64`, etc.
+
+When building with sanitizers enabled, :program:`lit` automatically adds the
+short name of the sanitizer, for example: `asan`, `tsan`, etc.
+
+To see the full list of features that can be added, see
+*llvm/utils/lit/lit/llvm/config.py*.
+
LIT EXAMPLE TESTS
~~~~~~~~~~~~~~~~~
diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index afb7f078072fc..eb4e21c7bbd67 100644
--- a/llvm/utils/lit/lit/llvm/config.py
+++ b/llvm/utils/lit/lit/llvm/config.py
@@ -131,6 +131,8 @@ def __init__(self, lit_config, config):
features.add("msan")
if "undefined" in sanitizers:
features.add("ubsan")
+ if "thread" in sanitizers:
+ features.add("tsan")
have_zlib = getattr(config, "have_zlib", None)
if have_zlib:
More information about the llvm-commits
mailing list