1 ;; With +relax, J below needs a relocation to ensure the target is correct
2 ;; after linker relaxation. See https://github.com/ClangBuiltLinux/linux/issues/1965
4 ; RUN: llc -mtriple=riscv64 -mattr=-relax -filetype=obj < %s \
5 ; RUN: | llvm-objdump -d -r - | FileCheck %s
6 ; RUN: llc -mtriple=riscv64 -mattr=+relax -filetype=obj < %s \
7 ; RUN: | llvm-objdump -d -r - | FileCheck %s --check-prefixes=CHECK,RELAX
10 ; RELAX-NEXT: R_RISCV_JAL {{.*}}
11 ; CHECK-NEXT: auipc ra, 0x0
12 ; CHECK-NEXT: R_RISCV_CALL_PLT f
13 ; RELAX-NEXT: R_RISCV_RELAX *ABS*
16 define dso_local noundef signext i32 @main() local_unnamed_addr #0 {
18 callbr void asm sideeffect ".option push\0A.option norvc\0A.option norelax\0Aj $0\0A.option pop\0A", "!i"() #2
19 to label %asm.fallthrough [label %label]
21 asm.fallthrough: ; preds = %entry
25 label: ; preds = %asm.fallthrough, %entry
31 attributes #0 = { nounwind "target-features"="-c,+relax" }