2 # RUN: rm -rf %t && split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=aarch64 %t/a.s -o %t/a.o
4 # RUN: ld.lld -pie -T %t/lds %t/a.o -o %t/a
5 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t/a | FileCheck %s
7 ## We create a thunk for dest.
9 # CHECK-NEXT: 8010008: b 0x801000c <__AArch64ADRPThunk_>
11 # CHECK-NEXT: <__AArch64ADRPThunk_>:
12 # CHECK-NEXT: 801000c: adrp x16, 0x10000
13 # CHECK-NEXT: add x16, x16, #4
16 ## The first instruction can reuse the thunk but the second can't.
17 ## If we reuse the thunk for b, we will get an "out of range" error.
18 # CHECK-LABEL: <high>:
19 # CHECK-NEXT: 1001000c: bl 0x801000c <__AArch64ADRPThunk_>
20 # CHECK-NEXT: b 0x10010014 <__AArch64ADRPThunk_>
22 # CHECK-NEXT: <__AArch64ADRPThunk_>:
23 # CHECK-NEXT: 10010014: adrp x16, 0x10000
24 # CHECK-NEXT: add x16, x16, #4
28 .section .text_low, "ax", %progbits
35 .section .text_mid, "ax", %progbits
39 .section .text_high, "ax", %progbits
46 .text_low 0x10000: { *(.text_low) }
47 .text_mid 0x8010008 : { *(.text_mid) }
48 .text_high 0x1001000c : { *(.text_high) }