40 lines · plain
1/// Check that functions with internal relocations are considered "simple" and2/// get transformed by BOLT. The tests rely on the "remove-nops" optimization:3/// if nops got removed from the function, it got transformed by BOLT.4 5// RUN: llvm-mc -triple riscv64 -filetype=obj -o %t.o %s6// RUN: ld.lld --emit-relocs -o %t %t.o7// RUN: llvm-bolt -o %t.bolt %t8// RUN: llvm-objdump -d %t.bolt | FileCheck %s9 10 .text11 .globl _start12 .p2align 213// CHECK: <_start>:14// CHECK-NEXT: j 0x{{.*}} <_start>15_start:16 nop171:18 j 1b19 .size _start, .-_start20 21 .globl f22 .p2align 223// CHECK: <f>:24// CHECK-NEXT: auipc a0, [[#]]25// CHECK-NEXT: addi a0, a0, [[#]]26f:27 nop281:29 /// Same as "la a0, g" but more explicit30 auipc a0, %pcrel_hi(g)31 addi a0, a0, %pcrel_lo(1b)32 ret33 .size f, .-f34 35 .globl g36 .p2align 237g:38 ret39 .size g, .-g40