117 lines · plain
1# This test checks relocations for control-flow instructions2 3# REQUIRES: system-linux4 5# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \6# RUN: %s -o %t.o7# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q8# RUN: llvm-bolt %t.exe -o %t.bolt --use-old-text=0 --lite=0 --trap-old-code9# RUN: %t.bolt10 11 .macro panic12.panic\@:13 mov x0, #014 br x015 .endm16 17 .text18 .align 419 .global test_call_foo20 .type test_call_foo, %function21test_call_foo:22 mov x0, x3023 add x0, x0, #824 br x025 panic26 .size test_call_foo, .-test_call_foo27 28 .global main29 .type main, %function30main:31 stp x30, x29, [sp, #-16]!32 b test_branch33 panic34test_branch:35 b test_cond_branch36 panic37 .size main, .-main38 39 .global test_cond_branch40 .type test_cond_branch, %function41test_cond_branch:42 mov x0, #043 cmp x0, #044 b.eq test_branch_reg45 panic46 .size test_cond_branch, .-test_cond_branch47 48 .global test_branch_reg49 .type test_branch_reg, %function50test_branch_reg:51 nop52 adr x0, test_branch_zero53 br x054 panic55 .size test_branch_reg, .-test_branch_reg56 57 .global test_branch_zero58 .type test_branch_zero, %function59test_branch_zero:60 mov x0, #061 cbz x0, test_branch_non_zero62 panic63 .size test_branch_zero, .-test_branch_zero64 65 .global test_branch_non_zero66 .type test_branch_non_zero, %function67test_branch_non_zero:68 mov x0, #169 cbnz x0, test_bit_branch_zero70 panic71 .size test_branch_non_zero, .-test_branch_non_zero72 73 .global test_bit_branch_zero74 .type test_bit_branch_zero, %function75test_bit_branch_zero:76 mov x0, #077 tbz x0, 0, test_bit_branch_non_zero78 panic79 .size test_bit_branch_zero, .-test_bit_branch_zero80 81 .global test_bit_branch_non_zero82 .type test_bit_branch_non_zero, %function83test_bit_branch_non_zero:84 mov x0, #185 tbnz x0, 0, test_call86 panic87 .size test_bit_branch_non_zero, .-test_bit_branch_non_zero88 89 .global test_call90 .type test_call, %function91test_call:92 bl test_call_foo93 panic94 b test_call_reg95 panic96 .size test_call, .-test_call97 98 .global test_call_reg99 .type test_call_reg, %function100test_call_reg:101 nop102 adr x0, test_call_foo103 blr x0104 panic105 b finalize106 panic107 .size test_call_reg, .-test_call_reg108 109 .global finalize110 .type finalize, %function111finalize:112 ldp x30, x29, [sp], #16113 mov x0, #0114 ret115 panic116 .size finalize, .-finalize117