blob: ca28c3c2a513920b883c9fc5ce38fe60802a304d [file] [edit]
# RUN: llvm-mc -triple=riscv64 -mattr=+c,+relax -filetype=obj %s -o %t.o
# RUN: ld.lld --emit-relocs %t.o -o %t.exe
# RUN: llvm-readelf -r %t.exe | FileCheck %s --check-prefix=INPUT
# RUN: llvm-bolt %t.exe --reorder-functions=cdsort -o %t.bolt 2>&1 | FileCheck %s
# RUN: llvm-objdump -d %t.bolt | FileCheck %s --check-prefix=CODE
## Retained R_RISCV_ALIGN relocations describe padding already handled by
## the linker. Check that BOLT accepts them and preserves valid code.
# INPUT: R_RISCV_ALIGN
# CHECK: BOLT-INFO: enabling relocation mode
# CHECK-NOT: Failed to analyze
# CODE: <_start>:
# CODE-NEXT: jal
# CODE: ret
.text
.globl _start
.type _start, @function
.p2align 2
_start:
call foo
.p2align 2
ret
.size _start, .-_start
.type foo, @function
foo:
ret
.size foo, .-foo