34 lines · plain
1## Check that llvm-bolt generates a proper error message when ADR instruction2## cannot be relaxed.3 4# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o5# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -static6# RUN: not llvm-bolt %t.exe -o %t.bolt 2>&1 | FileCheck %s7# RUN: not llvm-bolt %t.exe -o %t.bolt --strict 2>&1 | FileCheck %s8 9# CHECK: BOLT-ERROR: cannot relax ADR in non-simple function _start10 11## The function contains unknown control flow and llvm-bolt fails to recover12## CFG. As BOLT has to preserve the function layout, the ADR instruction cannot13## be relaxed into ADRP+ADD.14 .text15 .globl _start16 .type _start, %function17_start:18 .cfi_startproc19 adr x1, foo20 adr x2, .L121.L1:22 br x023 ret x024 .cfi_endproc25 .size _start, .-_start26 27 .globl foo28 .type foo, %function29foo:30 .cfi_startproc31 ret x032 .cfi_endproc33 .size foo, .-foo34