Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / aarch64-range-thunk-extension-plt32.s
blob1d09012a2295c9b30b4ab4ef96834a9e0200d4b7
1 // REQUIRES: aarch64
2 // RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o
3 // RUN: echo 'SECTIONS { \
4 // RUN: .text.1 0x10000 : { *(.text.1) } \
5 // RUN: .text.2 0x200000000 : AT(0x20000) { *(.text.2) } \
6 // RUN: } ' > %t.script
7 // RUN: ld.lld --script %t.script %t.o -o %t
8 // RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t | FileCheck %s
10 // The word should be an offset to the range extension thunk.
11 // CHECK-LABEL: <_start>:
12 // CHECK-NEXT: 10000: 04 00 00 00 .word 0x00000004
14 // The thunk redirects to the address of callee.
15 // CHECK-LABEL: <__AArch64AbsLongThunk_callee>:
16 // CHECK-NEXT: 10004: ldr x16, 0x1000c <__AArch64AbsLongThunk_callee+0x8>
17 // CHECK-NEXT: 10008: br x16
18 // CHECK-NEXT: 1000c: 00 00 00 00 .word 0x00000000
19 // CHECK-NEXT: 10010: 02 00 00 00 .word 0x00000002
21 // CHECK-LABEL: <callee>:
22 // CHECK-NEXT: 200000000: ret
24 .section .text.1, "ax", %progbits
25 .global _start
26 .type _start, %function
27 _start:
28 .word callee@PLT - .
30 .section .text.2, "ax", %progbits
31 .global callee
32 .type callee, %function
33 callee:
34 ret