[clang] [Clang][RISC-V] Fix lto-module-asm-abi.c on non-asserts/no-lld builds (PR #226752)
Alexander Richardson via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 26 21:48:50 PDT 2026
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/226752
Pass `-fno-discard-value-names` so the `entry:` label is preserved in
non-asserts builds, and drop `-fuse-ld=lld` so the driver check succeeds
on bots that do not have `ld.lld` installed.
>From 0905c19077bf1308546524a5601020c570644e56 Mon Sep 17 00:00:00 2001
From: Alex Richardson <alexrichardson at google.com>
Date: Sat, 26 Sep 2026 21:48:04 -0700
Subject: [PATCH] [Clang][RISC-V] Fix lto-module-asm-abi.c on
non-asserts/no-lld builds
Pass `-fno-discard-value-names` so the `entry:` label is preserved in
non-asserts builds, and drop `-fuse-ld=lld` so the driver check succeeds
on bots that do not have `ld.lld` installed.
Fixes: bf529329b5ce ("[RISC-V][LTO] Add baseline tests for LTO inline assembly and mapping symbols (#225129)")
---
clang/test/CodeGen/RISCV/lto-module-asm-abi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/clang/test/CodeGen/RISCV/lto-module-asm-abi.c b/clang/test/CodeGen/RISCV/lto-module-asm-abi.c
index cceafaac3ba0e..50242fdd3085d 100644
--- a/clang/test/CodeGen/RISCV/lto-module-asm-abi.c
+++ b/clang/test/CodeGen/RISCV/lto-module-asm-abi.c
@@ -4,7 +4,7 @@
/// Check that -march=rv64gcv -flto records +d in module asm and function
/// target-features even though the driver only passes mcpu=generic-rv64 to lld.
-// RUN: %clang --target=riscv64-linux-android -march=rv64gcv -flto %s -S -emit-llvm -o - \
+// RUN: %clang --target=riscv64-linux-android -march=rv64gcv -flto -fno-discard-value-names %s -S -emit-llvm -o - \
// RUN: | FileCheck %s --check-prefix=IR
// IR: module asm(target_features: "{{.*}}+d{{.*}}", target_cpu: "generic-rv64")
@@ -20,11 +20,11 @@
// IR-NEXT: ![[#]] = !{i32 6, !"riscv-isa", ![[#ISA:]]}
// IR-NEXT: ![[#ISA]] = !{!"{{.*}}_d2p2_{{.*}}"}
-// RUN: %clang --target=riscv64-linux-android -march=rv64gcv -flto -shared -nostdlib -fuse-ld=lld %s -### 2>&1 \
+// RUN: %clang --target=riscv64-linux-android -march=rv64gcv -flto -shared -nostdlib %s -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=DRIVER
// DRIVER: "-cc1"{{.*}}"-target-cpu" "generic-rv64"{{.*}}"-target-feature" "+d"{{.*}}"-target-abi" "lp64d"
-// DRIVER: "{{[^"]*}}ld.lld{{(\.exe)?}}"
+// DRIVER: "-m" "elf64lriscv"
// DRIVER-NOT: mattr
// DRIVER-SAME: "-plugin-opt=mcpu=generic-rv64"
// DRIVER-NOT: mattr
More information about the cfe-commits
mailing list