[llvm] [llvm][lit] Add tsan feature when enabled (PR #94573)
Keith Smiley via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 14:49:24 PDT 2024
https://github.com/keith updated https://github.com/llvm/llvm-project/pull/94573
>From dd994e1f1f6002b285f922388cf1dc75f60ec4b8 Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Thu, 6 Jun 2024 05:18:34 +0000
Subject: [PATCH 1/2] [llvm][lit] Add tsan feature when enabled
This mirrors the other sanitizer features above
---
llvm/utils/lit/lit/llvm/config.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index 1d4babc99984b..442455f7140f3 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:
>From 394f73fec2e195b80c0e6a4f66ad42bcde1b49b4 Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Fri, 7 Jun 2024 21:49:05 +0000
Subject: [PATCH 2/2] Add docs
---
llvm/docs/CommandGuide/lit.rst | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
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
~~~~~~~~~~~~~~~~~
More information about the llvm-commits
mailing list