[clang] [Driver][HIP/SPIRV] Fix crash when llvm-link is executed. (PR #196074)

Manuel Carrasco via cfe-commits cfe-commits at lists.llvm.org
Wed May 6 08:10:41 PDT 2026


================
@@ -0,0 +1,16 @@
+// Verify that SPIR-V compilation does not crash during the llvm-link step
+// due to extra args that are not meant to be forwarded there.
+//
+// RUN: %clang -### --target=spirv64-amd-amdhsa -use-spirv-backend \
+// RUN:   -Xlinker -opt-bisect-limit=-1 %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-LINKER-OPT
+//
+// RUN: %clang -### --target=spirv64-amd-amdhsa -use-spirv-backend \
+// RUN:   -Xlinker -mllvm -Xlinker -opt-bisect-limit=-1 %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-LINKER-MLLVM
+//
+// CHECK-LINKER-OPT: "{{.*}}llvm-link"
+// CHECK-LINKER-OPT-SAME: "-o" "{{.*}}" "{{.*}}"{{$}}
----------------
mgcarrasco wrote:

Thanks. The check now explicitly ensures that the unwanted flags are not there and also structurally enforces that no other flags could be there.

https://github.com/llvm/llvm-project/pull/196074


More information about the cfe-commits mailing list