[clang] [Clang][RISC-V] Fix lto-module-asm-abi.c on non-asserts/no-lld builds (PR #226752)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 26 21:49:28 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Alexander Richardson (arichardson)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/226752.diff
1 Files Affected:
- (modified) clang/test/CodeGen/RISCV/lto-module-asm-abi.c (+3-3)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/226752
More information about the cfe-commits
mailing list