]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/aarch64-tls-iele.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / aarch64-tls-iele.s
1 # REQUIRES: aarch64
2 # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %p/Inputs/aarch64-tls-ie.s -o %ttlsie.o
3 # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %s -o %tmain.o
4 # RUN: ld.lld %tmain.o %ttlsie.o -o %tout
5 # RUN: llvm-objdump -d %tout | FileCheck %s
6 # RUN: llvm-readobj -s -r %tout | FileCheck -check-prefix=RELOC %s
7
8 # Initial-Exec to Local-Exec relax creates no dynamic relocations.
9 # RELOC:      Relocations [
10 # RELOC-NEXT: ]
11
12 # TCB size = 0x16 and foo is first element from TLS register.
13 # CHECK: Disassembly of section .text:
14 # CHECK: _start:
15 # CHECK-NEXT: 20000:  00 00 a0 d2   movz   x0, #0, lsl #16
16 # CHECK-NEXT: 20004:  80 02 80 f2   movk   x0, #20
17 # CHECK-NEXT: 20008:  00 00 a0 d2   movz   x0, #0, lsl #16
18 # CHECK-NEXT: 2000c:  00 02 80 f2   movk   x0, #16
19
20 .section .tdata
21 .align 2
22 .type foo_local, %object
23 .size foo_local, 4
24 foo_local:
25 .word 5
26 .text
27
28 .globl _start
29 _start:
30  adrp    x0, :gottprel:foo
31  ldr     x0, [x0, :gottprel_lo12:foo]
32  adrp    x0, :gottprel:foo_local
33  ldr     x0, [x0, :gottprel_lo12:foo_local]