[compiler-rt] [compiler-rt][nsan] Add lit config for tests (PR #100286)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 17:19:56 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r e59a619acf0b829f34a1c63aab0ad829ca0defc9...2e3f5e08a439db1fc8e0f191432120a4737ed46b compiler-rt/test/nsan/lit.cfg.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- lit.cfg.py 2024-07-24 00:15:37.000000 +0000
+++ lit.cfg.py 2024-07-24 00:19:31.034406 +0000
@@ -1,29 +1,36 @@
-config.name = 'NSan' + config.name_suffix
+config.name = "NSan" + config.name_suffix
# Setup source root.
config.test_source_root = os.path.dirname(__file__)
# Test suffixes.
-config.suffixes = ['.c', '.cpp', '.test']
+config.suffixes = [".c", ".cpp", ".test"]
# C & CXX flags.
-c_flags = ([config.target_cflags])
+c_flags = [config.target_cflags]
# CXX flags
-cxx_flags = (c_flags + config.cxx_mode_flags + ["-std=c++17"])
+cxx_flags = c_flags + config.cxx_mode_flags + ["-std=c++17"]
-nsan_flags = ["-fsanitize=numerical", "-g",
- "-mno-omit-leaf-frame-pointer",
- "-fno-omit-frame-pointer"]
+nsan_flags = [
+ "-fsanitize=numerical",
+ "-g",
+ "-mno-omit-leaf-frame-pointer",
+ "-fno-omit-frame-pointer",
+]
+
def build_invocation(compile_flags):
- return " " + " ".join([config.clang] + compile_flags) + " "
+ return " " + " ".join([config.clang] + compile_flags) + " "
+
# Add substitutions.
config.substitutions.append(("%clang ", build_invocation(c_flags)))
config.substitutions.append(("%clang_nsan ", build_invocation(c_flags + nsan_flags)))
-config.substitutions.append(("%clangxx_nsan ", build_invocation(cxx_flags + nsan_flags)))
+config.substitutions.append(
+ ("%clangxx_nsan ", build_invocation(cxx_flags + nsan_flags))
+)
# NSan tests are currently supported on Linux only.
-if config.host_os not in ['Linux']:
- config.unsupported = True
+if config.host_os not in ["Linux"]:
+ config.unsupported = True
``````````
</details>
https://github.com/llvm/llvm-project/pull/100286
More information about the llvm-commits
mailing list