[clang] f55411f - [clang][test] Use ToolSubst for spirv-tools lit substitutions (#192906)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 07:22:29 PDT 2026


Author: Arseniy Obolenskiy
Date: 2026-04-20T14:22:24Z
New Revision: f55411f35194dcb70685b68aa0989243d5c0c559

URL: https://github.com/llvm/llvm-project/commit/f55411f35194dcb70685b68aa0989243d5c0c559
DIFF: https://github.com/llvm/llvm-project/commit/f55411f35194dcb70685b68aa0989243d5c0c559.diff

LOG: [clang][test] Use ToolSubst for spirv-tools lit substitutions (#192906)

Bare-string substitutions match as substrings and the replacement path
contains the tool name, causing corrupted RUN lines

The issue is reproducible, for example, when path to llvm has tool name
substring at any point

Based on change for llvm tests:
https://github.com/llvm/llvm-project/pull/192462

Added: 
    

Modified: 
    clang/test/Tooling/lit.local.cfg

Removed: 
    


################################################################################
diff  --git a/clang/test/Tooling/lit.local.cfg b/clang/test/Tooling/lit.local.cfg
index 46d32e6ebf454..9cda4b31e81da 100644
--- a/clang/test/Tooling/lit.local.cfg
+++ b/clang/test/Tooling/lit.local.cfg
@@ -5,7 +5,7 @@ if not config.root.clang_staticanalyzer:
 
 if config.spirv_tools_tests:
     config.available_features.add("spirv-tools")
-    config.substitutions.append(("spirv-dis", os.path.join(config.llvm_tools_dir, "spirv-dis")))
-    config.substitutions.append(("spirv-val", os.path.join(config.llvm_tools_dir, "spirv-val")))
-    config.substitutions.append(("spirv-as", os.path.join(config.llvm_tools_dir, "spirv-as")))
-    config.substitutions.append(("spirv-link", os.path.join(config.llvm_tools_dir, "spirv-link")))
+    from lit.llvm import llvm_config
+    llvm_config.add_tool_substitutions(
+        ["spirv-dis", "spirv-val", "spirv-as", "spirv-link"]
+    )


        


More information about the cfe-commits mailing list