Skip to content

Conversation

@bd1976bris
Copy link
Collaborator

Previously I masked issues with Multicall + DTLTO (see #148908) due to an incomplete understanding of how the Multicall toolchain works.

This patch reverts those incorrect changes and instead marks the affected tests XFAIL when running under Multicall.

Issue #159125 tracks fixing DTLTO with Multicall.

Previously I masked issues with Multicall + DTLTO (see llvm#148908) due to an
incomplete understanding of how the Multicall toolchain works.

This patch reverts those incorrect changes and instead marks the
affected tests XFAIL when running under Multicall.

Issue llvm#159125 tracks fixing DTLTO with Multicall.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Sep 16, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 16, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: bd1976bris (bd1976bris)

Changes

Previously I masked issues with Multicall + DTLTO (see #148908) due to an incomplete understanding of how the Multicall toolchain works.

This patch reverts those incorrect changes and instead marks the affected tests XFAIL when running under Multicall.

Issue #159125 tracks fixing DTLTO with Multicall.


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

2 Files Affected:

  • (modified) clang/test/Driver/DTLTO/dtlto.c (+4-1)
  • (modified) clang/test/Driver/DTLTO/ps5-dtlto.c (+4-1)
diff --git a/clang/test/Driver/DTLTO/dtlto.c b/clang/test/Driver/DTLTO/dtlto.c
index 96795d9a4e6a4..053955a9e3d4a 100644
--- a/clang/test/Driver/DTLTO/dtlto.c
+++ b/clang/test/Driver/DTLTO/dtlto.c
@@ -1,5 +1,8 @@
 // REQUIRES: lld
 
+/// https://github.com/llvm/llvm-project/issues/159125.
+// XFAIL: llvm-driver
+
 /// Check DTLTO options are forwarded to the linker.
 
 /// Check that options are forwarded as expected with --thinlto-distributor=.
@@ -10,7 +13,7 @@
 
 // FORWARD: ld.lld
 // FORWARD-SAME: "--thinlto-distributor=d.exe"
-// FORWARD-SAME: "--thinlto-remote-compiler={{[^"]+}}"
+// FORWARD-SAME: "--thinlto-remote-compiler={{.*}}clang{{[^\"]*}}"
 // FORWARD-SAME: "--thinlto-distributor-arg=a1"
 // FORWARD-SAME: "--thinlto-distributor-arg=a2"
 // FORWARD-SAME: "--thinlto-distributor-arg=a3"
diff --git a/clang/test/Driver/DTLTO/ps5-dtlto.c b/clang/test/Driver/DTLTO/ps5-dtlto.c
index 9b70c88257a85..eb4691da9d2fc 100644
--- a/clang/test/Driver/DTLTO/ps5-dtlto.c
+++ b/clang/test/Driver/DTLTO/ps5-dtlto.c
@@ -1,5 +1,8 @@
 // REQUIRES: lld
 
+/// https://github.com/llvm/llvm-project/issues/159125.
+// XFAIL: llvm-driver
+
 /// Check DTLTO options are forwarded to the linker.
 
 /// Check that options are forwarded as expected with --thinlto-distributor=.
@@ -10,7 +13,7 @@
 
 // FORWARD: prospero-lld
 // FORWARD-SAME: "--thinlto-distributor=d.exe"
-// FORWARD-SAME: "--thinlto-remote-compiler={{[^"]+}}"
+// FORWARD-SAME: "--thinlto-remote-compiler={{.*}}clang{{[^\"]*}}"
 // FORWARD-SAME: "--thinlto-distributor-arg=a1"
 // FORWARD-SAME: "--thinlto-distributor-arg=a2"
 // FORWARD-SAME: "--thinlto-distributor-arg=a3"

@bd1976bris bd1976bris merged commit 7bc91f3 into llvm:main Sep 16, 2025
12 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 16, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building clang at step 7 "Add check check-clang".

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

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-clang) failure: test (failure)
******************** TEST 'Clang :: Driver/DTLTO/dtlto.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -flto=thin /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/DTLTO/dtlto.c -### -fuse-ld=lld --target=x86_64-linux-gnu    -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3    -fthinlto-distributor=d.exe -Werror 2>&1 |    /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/DTLTO/dtlto.c --check-prefix=FORWARD # RUN: at line 9
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -flto=thin /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/DTLTO/dtlto.c -### -fuse-ld=lld --target=x86_64-linux-gnu -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 -fthinlto-distributor=d.exe -Werror
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/DTLTO/dtlto.c --check-prefix=FORWARD
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/DTLTO/dtlto.c:17:18: error: FORWARD-SAME: expected string not found in input
// FORWARD-SAME: "--thinlto-distributor-arg=a1"
                 ^
<stdin>:7:1628: note: scanning from here
 "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld.lld" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "/lib/x86_64-linux-gnu/Scrt1.o" "/lib/x86_64-linux-gnu/crti.o" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtbegin.o" "-L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/x86_64-unknown-linux-gnu" "-L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu" "-L/usr/lib/gcc/x86_64-linux-gnu/12" "-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib64" "-L/lib/x86_64-linux-gnu" "-L/lib/../lib64" "-L/usr/lib/x86_64-linux-gnu" "-L/usr/lib64" "-L/lib" "-L/usr/lib" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang-22" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "/tmp/lit-tmp-dd4pzb8j/dtlto-7ca18f.o" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a" "--as-needed" "-lgcc_s" "--no-as-needed" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtend.o" "/lib/x86_64-linux-gnu/crtn.o"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
<stdin>:7:1639: note: possible intended match here
 "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld.lld" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "/lib/x86_64-linux-gnu/Scrt1.o" "/lib/x86_64-linux-gnu/crti.o" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtbegin.o" "-L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/x86_64-unknown-linux-gnu" "-L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu" "-L/usr/lib/gcc/x86_64-linux-gnu/12" "-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib64" "-L/lib/x86_64-linux-gnu" "-L/lib/../lib64" "-L/usr/lib/x86_64-linux-gnu" "-L/usr/lib64" "-L/lib" "-L/usr/lib" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang-22" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "/tmp/lit-tmp-dd4pzb8j/dtlto-7ca18f.o" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a" "--as-needed" "-lgcc_s" "--no-as-needed" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtend.o" "/lib/x86_64-linux-gnu/crtn.o"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ^

Input file: <stdin>
Check file: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/DTLTO/dtlto.c

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: clang version 22.0.0git (https://github.com/llvm/llvm-project.git 7bc91f3580836c13cfcf511147585a5f2f00a7f5) 
           2: Target: x86_64-unknown-linux-gnu 
           3: Thread model: posix 
           4: InstalledDir: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin 
           5: Build config: +assertions 
           6:  "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang-22" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" "-flto=thin" "-flto-unit" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "dtlto.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/test/Driver/DTLTO" "-fcoverage-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/test/Driver/DTLTO" "-resource-dir" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22" "-internal-isystem" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include" "-internal-externc-isystem" "/usr/include/x86_64-linux-gnu" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-Werror" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/lit-tmp-dd4pzb8j/dtlto-7ca18f.o" "-x" "c" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/DTLTO/dtlto.c" 
           7:  "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld.lld" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "/lib/x86_64-linux-gnu/Scrt1.o" "/lib/x86_64-linux-gnu/crti.o" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtbegin.o" "-L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/x86_64-unknown-linux-gnu" "-L/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu" "-L/usr/lib/gcc/x86_64-linux-gnu/12" "-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib64" "-L/lib/x86_64-linux-gnu" "-L/lib/../lib64" "-L/usr/lib/x86_64-linux-gnu" "-L/usr/lib64" "-L/lib" "-L/usr/lib" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang-22" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "/tmp/lit-tmp-dd4pzb8j/dtlto-7ca18f.o" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a" "--as-needed" "-lgcc_s" "--no-as-needed" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/lib/x86_64-unknown-linux-gnu/clang_rt.crtend.o" "/lib/x86_64-linux-gnu/crtn.o" 
same:17'0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
same:17'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ?                     possible intended match
>>>>>>

--

********************


@jplehr
Copy link
Contributor

jplehr commented Sep 16, 2025

Hi, it appears this breaks one of our bots. Can this be reverted or forward-fixed?

@bd1976bris
Copy link
Collaborator Author

I will try to put up a forward fix in the next 10 mins or so.

bd1976bris added a commit to bd1976bris/llvm-project that referenced this pull request Sep 16, 2025
The Clang driver tests tried to match the Clang executable name via a
regular expression. This failed on some buildbots where the name was not
anticipated.

Make the test more robust by extracting the filename with Python and
appending a line to the output. This is then captured into a FileCheck
variable and used directly in the check for the executable name.

Should fix buildbot failures caused by the merge of PR llvm#159129.
bd1976bris added a commit that referenced this pull request Sep 16, 2025
)

Make the test regexes more permissive to fix buildbot failures caused by
the merge of PR #159129. This mirrors the earlier fix in PR #148908. We
retain cross-project-test coverage to verify that the path content is
correct.

A follow-up will update the tests to robustly check the Clang executable
filename, likely along the lines of PR #159151.

Short-term unbreak to keep the buildbots green without reverting a chain
of commits.
@petrhosek
Copy link
Member

This change also appears to have broken our Windows builders:

Exit Code: 1

Command Output (stdout):
--
# RUN: at line 9
c:\b\s\w\ir\x\w\llvm_build\bin\clang.exe -flto=thin C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c -### -fuse-ld=lld --target=x86_64-linux-gnu    -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3    -fthinlto-distributor=d.exe -Werror 2>&1 |    c:\b\s\w\ir\x\w\llvm_build\bin\filecheck.exe C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c --check-prefix=FORWARD
# executed command: 'c:\b\s\w\ir\x\w\llvm_build\bin\clang.exe' -flto=thin 'C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c' '-###' -fuse-ld=lld --target=x86_64-linux-gnu -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 -fthinlto-distributor=d.exe -Werror
# executed command: 'c:\b\s\w\ir\x\w\llvm_build\bin\filecheck.exe' 'C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c' --check-prefix=FORWARD
# .---command stderr------------
# | C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c:17:18: error: FORWARD-SAME: expected string not found in input
# | // FORWARD-SAME: "--thinlto-distributor-arg=a1"
# |                  ^
# | <stdin>:7:787: note: scanning from here
# |  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\ld.lld" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "Scrt1.o" "crti.o" "crtbeginS.o" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "-lc" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "crtendS.o" "crtn.o"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
# | <stdin>:7:830: note: possible intended match here
# |  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\ld.lld" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "Scrt1.o" "crti.o" "crtbeginS.o" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "-lc" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "crtendS.o" "crtn.o"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
# | 
# | Input file: <stdin>
# | Check file: C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: Fuchsia clang version 22.0.0git (https://llvm.googlesource.com/llvm-project a3762fb2405475c46c18a647f18d342f5e2332e3) 
# |            2: Target: x86_64-unknown-linux-gnu 
# |            3: Thread model: posix 
# |            4: InstalledDir: C:\b\s\w\ir\x\w\llvm_build\bin 
# |            5: Build config: +assertions 
# |            6:  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" "-flto=thin" "-flto-unit" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "dtlto.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debugger-tuning=gdb" "-fdebug-compilation-dir=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\tools\\clang\\test\\Driver\\DTLTO" "-fcoverage-compilation-dir=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\tools\\clang\\test\\Driver\\DTLTO" "-resource-dir" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22" "-internal-isystem" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-Werror" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "-x" "c" "C:\\b\\s\\w\\ir\\x\\w\\llvm-llvm-project\\clang\\test\\Driver\\DTLTO\\dtlto.c" 
# |            7:  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\ld.lld" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "Scrt1.o" "crti.o" "crtbeginS.o" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "-lc" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "crtendS.o" "crtn.o" 
# | same:17'0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# | same:17'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ?                     possible intended match
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

bd1976bris added a commit that referenced this pull request Sep 17, 2025
The Clang driver tests tried to match the Clang executable name via a
regular expression. This failed on some buildbots where the name was not
anticipated.

Make the test more robust by extracting the filename with Python and
appending a line to the output. This is then captured into a FileCheck
variable and used directly in the check for the executable name.

Should fix buildbot failures caused by the merge of PR #159129.
@bd1976bris
Copy link
Collaborator Author

This change also appears to have broken our Windows builders:

Exit Code: 1

Command Output (stdout):
--
# RUN: at line 9
c:\b\s\w\ir\x\w\llvm_build\bin\clang.exe -flto=thin C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c -### -fuse-ld=lld --target=x86_64-linux-gnu    -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3    -fthinlto-distributor=d.exe -Werror 2>&1 |    c:\b\s\w\ir\x\w\llvm_build\bin\filecheck.exe C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c --check-prefix=FORWARD
# executed command: 'c:\b\s\w\ir\x\w\llvm_build\bin\clang.exe' -flto=thin 'C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c' '-###' -fuse-ld=lld --target=x86_64-linux-gnu -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 -fthinlto-distributor=d.exe -Werror
# executed command: 'c:\b\s\w\ir\x\w\llvm_build\bin\filecheck.exe' 'C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c' --check-prefix=FORWARD
# .---command stderr------------
# | C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c:17:18: error: FORWARD-SAME: expected string not found in input
# | // FORWARD-SAME: "--thinlto-distributor-arg=a1"
# |                  ^
# | <stdin>:7:787: note: scanning from here
# |  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\ld.lld" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "Scrt1.o" "crti.o" "crtbeginS.o" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "-lc" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "crtendS.o" "crtn.o"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
# | <stdin>:7:830: note: possible intended match here
# |  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\ld.lld" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "Scrt1.o" "crti.o" "crtbeginS.o" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "-lc" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "crtendS.o" "crtn.o"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
# | 
# | Input file: <stdin>
# | Check file: C:\b\s\w\ir\x\w\llvm-llvm-project\clang\test\Driver\DTLTO\dtlto.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: Fuchsia clang version 22.0.0git (https://llvm.googlesource.com/llvm-project a3762fb2405475c46c18a647f18d342f5e2332e3) 
# |            2: Target: x86_64-unknown-linux-gnu 
# |            3: Thread model: posix 
# |            4: InstalledDir: C:\b\s\w\ir\x\w\llvm_build\bin 
# |            5: Build config: +assertions 
# |            6:  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" "-flto=thin" "-flto-unit" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "dtlto.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debugger-tuning=gdb" "-fdebug-compilation-dir=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\tools\\clang\\test\\Driver\\DTLTO" "-fcoverage-compilation-dir=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\tools\\clang\\test\\Driver\\DTLTO" "-resource-dir" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22" "-internal-isystem" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-Werror" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "-x" "c" "C:\\b\\s\\w\\ir\\x\\w\\llvm-llvm-project\\clang\\test\\Driver\\DTLTO\\dtlto.c" 
# |            7:  "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\ld.lld" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "Scrt1.o" "crti.o" "crtbeginS.o" "-plugin-opt=mcpu=x86-64" "-plugin-opt=thinlto" "--thinlto-distributor=d.exe" "--thinlto-remote-compiler=C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\bin\\clang.exe" "--thinlto-distributor-arg=a1" "--thinlto-distributor-arg=a2" "--thinlto-distributor-arg=a3" "C:\\b\\s\\w\\ir\\x\\t\\lit-tmp-dw4aq672\\dtlto-029f91.o" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "-lc" "C:\\b\\s\\w\\ir\\x\\w\\llvm_build\\lib\\clang\\22\\lib\\x86_64-unknown-linux-gnu\\libclang_rt.builtins.a" "--as-needed" "-lunwind" "--no-as-needed" "crtendS.o" "crtn.o" 
# | same:17'0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# | same:17'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ?                     possible intended match
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

Yes. Thanks. I'll do that now. The underlying issue that DLTTO doesn't work with Multicall is still present but I think that the test will pass now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants