[llvm] [BOLT][RISCV] Fix call-relocation-pair test after NOP removal (PR #222308)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 04:59:49 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Alexander Wilson (rdtscp)
<details>
<summary>Changes</summary>
The test introduced by https://github.com/llvm/llvm-project/pull/216882 expects temporary NOPs from FixRISCVCalls in the emitted binary. https://github.com/llvm/llvm-project/pull/221965 marks those NOPs for removal, causing FileCheck to match trailing alignment padding instead of the rewritten calls.
This caused the call-relocation-pair.s failure on [bolt-aarch64-ubuntu-dylib, build 6378](https://lab.llvm.org/buildbot/#/builders/216/builds/6378).
Check emitted calls independently of the temporary NOPs and verify the forward-call target symbols. Preserve the intermediate-pass NOP checks.
Validation: all five test RUN commands pass with local BOLT builds that retain and remove the temporary NOPs. The original test reproduces the reported FileCheck failure with the NOP-removing build.
---
Full diff: https://github.com/llvm/llvm-project/pull/222308.diff
1 Files Affected:
- (modified) bolt/test/RISCV/call-relocation-pair.s (+8-8)
``````````diff
diff --git a/bolt/test/RISCV/call-relocation-pair.s b/bolt/test/RISCV/call-relocation-pair.s
index ea1c55d1ebcde..0a0099de83e6d 100644
--- a/bolt/test/RISCV/call-relocation-pair.s
+++ b/bolt/test/RISCV/call-relocation-pair.s
@@ -20,15 +20,15 @@
// BOLT-NEXT: nop
// BOLT-NEXT: call target_backward
+// The temporary NOPs created by fix-riscv-calls may be removed before
+// emission. Check the rewritten calls and their targets independently of them.
// OBJDUMP-LABEL: <_start>:
-// OBJDUMP: nop
-// OBJDUMP-NEXT: auipc ra,
-// OBJDUMP-NEXT: jalr {{.*}}(ra)
-// OBJDUMP-NEXT: nop
-// OBJDUMP-NEXT: auipc ra,
-// OBJDUMP-NEXT: jalr {{.*}}(ra)
-// OBJDUMP-NEXT: nop
-// OBJDUMP-NEXT: jal {{.*}} <target_backward>
+// OBJDUMP: auipc ra,
+// OBJDUMP-NEXT: jalr {{.*}}(ra) <target_call>
+// OBJDUMP: auipc ra,
+// OBJDUMP-NEXT: jalr {{.*}}(ra) <target_call_plt>
+// OBJDUMP: jal {{.*}} <target_backward>
+// OBJDUMP-NEXT: ret
// OBJDUMP-LABEL: <target_call>:
// OBJDUMP-LABEL: <target_call_plt>:
``````````
</details>
https://github.com/llvm/llvm-project/pull/222308
More information about the llvm-commits
mailing list