[clang] [Driver] Handle mips*-*-none-elf triples (PR #196322)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 13 12:01:15 PDT 2026
================
@@ -0,0 +1,40 @@
+// UNSUPPORTED: system-windows
+
+// Verify that mips*-*-none-elf triples are handled by the BareMetal toolchain,
+// i.e. clang drives ld.lld directly with the correct ELF emulation instead of
+// delegating to a $target-gcc.
+
+// RUN: %clang -### %s -fuse-ld=lld -B%S/Inputs/lld \
+// RUN: --target=mips-none-elf --sysroot= 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-BAREMETAL %s
+// MIPS-BAREMETAL: "-cc1" "-triple" "mips-unknown-none-elf"
+// MIPS-BAREMETAL: "{{.*}}/Inputs/lld/ld.lld"
+// MIPS-BAREMETAL: "-Bstatic" "-m" "elf32btsmip"
+
+// RUN: %clang -### %s -fuse-ld=lld -B%S/Inputs/lld \
+// RUN: --target=mipsel-none-elf --sysroot= 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPSEL-BAREMETAL %s
+// MIPSEL-BAREMETAL: "-cc1" "-triple" "mipsel-unknown-none-elf"
+// MIPSEL-BAREMETAL: "{{.*}}/Inputs/lld/ld.lld"
+// MIPSEL-BAREMETAL: "-Bstatic" "-m" "elf32ltsmip"
+
+// RUN: %clang -### %s -fuse-ld=lld -B%S/Inputs/lld \
+// RUN: --target=mips64-none-elf --sysroot= 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS64-BAREMETAL %s
+// MIPS64-BAREMETAL: "-cc1" "-triple" "mips64-unknown-none-elf"
+// MIPS64-BAREMETAL: "{{.*}}/Inputs/lld/ld.lld"
----------------
MaskRay wrote:
Use `-SAME` whenever applicable
https://github.com/llvm/llvm-project/pull/196322
More information about the cfe-commits
mailing list