Skip to content

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

Merged
sarnex merged 1 commit into
llvm:mainfrom
aobolensk:clang-tooling-spirv-subst
Apr 20, 2026
Merged

[clang][test] Use ToolSubst for spirv-tools lit substitutions#192906
sarnex merged 1 commit into
llvm:mainfrom
aobolensk:clang-tooling-spirv-subst

Conversation

@aobolensk
Copy link
Copy Markdown
Contributor

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: #192462

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: llvm#192462
@aobolensk aobolensk requested a review from sarnex April 20, 2026 07:35
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 20, 2026
@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Apr 20, 2026

@llvm/pr-subscribers-clang

Author: Arseniy Obolenskiy (aobolensk)

Changes

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: #192462


Full diff: https://github.com/llvm/llvm-project/pull/192906.diff

1 Files Affected:

  • (modified) clang/test/Tooling/lit.local.cfg (+4-4)
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"]
+    )

Copy link
Copy Markdown
Member

@sarnex sarnex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@sarnex sarnex merged commit f55411f into llvm:main Apr 20, 2026
12 checks passed
@llvm-ci
Copy link
Copy Markdown

llvm-ci commented Apr 20, 2026

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-5 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/40893

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang-Unit :: ./AllClangUnitTests/23/51' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/tools/clang/unittests/./AllClangUnitTests-Clang-Unit-86162-23-51.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=51 GTEST_SHARD_INDEX=23 /Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/tools/clang/unittests/./AllClangUnitTests
--

Script:
--
/Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/tools/clang/unittests/./AllClangUnitTests --gtest_filter=TimeProfilerTest.ConstantEvaluationC99
--
/Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/unittests/Support/TimeProfilerTest.cpp:366: Failure
Expected equality of these values:
  R"(
ExecuteCompiler
| Frontend (test.c)
| | ParseDeclarationOrFunctionDefinition (test.c:2:1)
| | | isIntegerConstantExpr (<test.c:3:18>)
| | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)
| PerformPendingInstantiations
)"
    Which is: "\nExecuteCompiler\n| Frontend (test.c)\n| | ParseDeclarationOrFunctionDefinition (test.c:2:1)\n| | | isIntegerConstantExpr (<test.c:3:18>)\n| | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)\n| PerformPendingInstantiations\n"
  buildTraceGraph(Json)
    Which is: "\nExecuteCompiler\n| Frontend (test.c)\n| | ParseDeclarationOrFunctionDefinition (test.c:2:1)\n| | | isIntegerConstantExpr (<test.c:3:18>)\n| | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)\n| | | PerformPendingInstantiations\n"
With diff:
@@ -5,3 +5,3 @@
 | | | isIntegerConstantExpr (<test.c:3:18>)
 | | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)
-| PerformPendingInstantiations\n
+| | | PerformPendingInstantiations\n



/Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/unittests/Support/TimeProfilerTest.cpp:366
Expected equality of these values:
  R"(
ExecuteCompiler
| Frontend (test.c)
| | ParseDeclarationOrFunctionDefinition (test.c:2:1)
| | | isIntegerConstantExpr (<test.c:3:18>)
| | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)
| PerformPendingInstantiations
)"
    Which is: "\nExecuteCompiler\n| Frontend (test.c)\n| | ParseDeclarationOrFunctionDefinition (test.c:2:1)\n| | | isIntegerConstantExpr (<test.c:3:18>)\n| | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)\n| PerformPendingInstantiations\n"
  buildTraceGraph(Json)
    Which is: "\nExecuteCompiler\n| Frontend (test.c)\n| | ParseDeclarationOrFunctionDefinition (test.c:2:1)\n| | | isIntegerConstantExpr (<test.c:3:18>)\n| | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)\n| | | PerformPendingInstantiations\n"
With diff:
@@ -5,3 +5,3 @@
 | | | isIntegerConstantExpr (<test.c:3:18>)
 | | | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)
-| PerformPendingInstantiations\n
...

s-perron pushed a commit to s-perron/llvm-project that referenced this pull request Apr 21, 2026
…92906)

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:
llvm#192462
KHicketts pushed a commit to KHicketts/llvm-project that referenced this pull request Apr 30, 2026
…92906)

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:
llvm#192462
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants