[clang] [Hexagon][Driver] Recognize versioned ld.lld as LLD (PR #228982)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 13 08:01:56 PDT 2026
================
@@ -688,19 +688,45 @@
// -----------------------------------------------------------------------------
// Passing -fno-use-init-array
// -----------------------------------------------------------------------------
-// RUN: %clang --sysroot= -### --target=hexagon-unknown-elf \
+// RUN: %clang -### --target=hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
// RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK384 %s
// CHECK384: "-fno-use-init-array"
// -----------------------------------------------------------------------------
// ThinLTO passes LTO options to the linker
// -----------------------------------------------------------------------------
// RUN: touch %t.o
-// RUN: %clang --sysroot= -### --target=hexagon-unknown-elf \
+// RUN: %clang -### --target=hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
// RUN: -mcpu=hexagonv60 \
// RUN: -fuse-ld=lld \
// RUN: -flto=thin -fenable-matrix \
// RUN: %t.o 2>&1 | FileCheck -check-prefix=CHECK-LTO %s
// CHECK-LTO: "-plugin-opt=thinlto"
// CHECK-LTO: "-plugin-opt=-enable-matrix"
+
+// -----------------------------------------------------------------------------
+// Versioned ld.lld is recognized as LLD
+// -----------------------------------------------------------------------------
+// RUN: %clang -### --target=hexagon-unknown-elf \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN: -mcpu=hexagonv60 \
+// RUN: --ld-path=%S/Inputs/hexagon_tree/Tools/bin/ld.lld-23 \
+// RUN: -nostdlib %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-VERSIONED-LLD %s
+// CHECK-VERSIONED-LLD: "{{.*}}ld.lld-23"
+// CHECK-VERSIONED-LLD-NOT: "-march=hexagon"
+// CHECK-VERSIONED-LLD-NOT: "-mcpu=hexagonv60"
+
+// -----------------------------------------------------------------------------
+// Triple-prefixed ld.lld is recognized as LLD
+// -----------------------------------------------------------------------------
+// RUN: %clang -### --target=hexagon-unknown-elf \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN: -mcpu=hexagonv60 -fuse-ld=gold \
+// RUN: --ld-path=%S/Inputs/hexagon_tree/Tools/bin/hexagon-unknown-elf-ld.lld \
----------------
quic-k wrote:
yeah, --ld-path takes precedence over -fuse-ld, just wanted to make sure lld is identified
https://github.com/llvm/llvm-project/pull/228982
More information about the cfe-commits
mailing list