Re-land [openmp] Fix warnings when building on Windows with latest MSVC or Clang...
[llvm-project.git] / llvm / test / CodeGen / RISCV / option-relax-relocation.ll
blob3dc5aa64bb3689fa0be37fe2d82f85eadd9f9f48
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
9 ; CHECK:        j       {{.*}}
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*
14 ; CHECK-NEXT:   jalr    ra
16 define dso_local noundef signext i32 @main() local_unnamed_addr #0 {
17 entry:
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
22   tail call void @f()
23   br label %label
25 label:                                            ; preds = %asm.fallthrough, %entry
26   ret i32 0
29 declare void @f()
31 attributes #0 = { nounwind "target-features"="-c,+relax" }