[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / aarch64-tlsld-ldst.s
blobbad35013105fc864a3604ab6542242e027c812c3
1 // REQUIRES: aarch64
2 // RUN: llvm-mc -triple=aarch64-linux-gnu -filetype=obj %s -o %t.o
3 // RUN: ld.lld %t.o -o %t
4 // RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s
5 // RUN: llvm-readelf --symbols %t | FileCheck -check-prefix CHECK-SYMS %s
7 .text
8 .globl _start
9 .type _start, %function
10 _start: mrs x8, TPIDR_EL0
12 add x8, x8, :tprel_hi12:var0
13 ldr q20, [x8, :tprel_lo12_nc:var0]
15 add x8, x8, :tprel_hi12:var1
16 ldr x0, [x8, :tprel_lo12_nc:var1]
18 add x8, x8, :tprel_hi12:var2
19 ldr w0, [x8, :tprel_lo12_nc:var2]
21 add x8, x8, :tprel_hi12:var3
22 ldrh w0, [x8, :tprel_lo12_nc:var3]
24 add x8, x8, :tprel_hi12:var4
25 ldrb w0, [x8, :tprel_lo12_nc:var4]
27 // CHECK: <_start>:
28 // CHECK-NEXT: 210158: mrs x8, TPIDR_EL0
29 // 0x0 + c10 = 0xc10 = tcb (16-bytes) + var0
30 // CHECK-NEXT: 21015c: add x8, x8, #0, lsl #12
31 // CHECK-NEXT: 210160: ldr q20, [x8, #3088]
32 // 0x1000 + 0x820 = 0x1820 = tcb + var1
33 // CHECK-NEXT: 210164: add x8, x8, #1, lsl #12
34 // CHECK-NEXT: 210168: ldr x0, [x8, #2080]
35 // 0x2000 + 0x428 = 0x2428 = tcb + var2
36 // CHECK-NEXT: 21016c: add x8, x8, #2, lsl #12
37 // CHECK-NEXT: 210170: ldr w0, [x8, #1064]
38 // 0x3000 + 0x2c = 0x302c = tcb + var3
39 // CHECK-NEXT: 210174: add x8, x8, #3, lsl #12
40 // CHECK-NEXT: 210178: ldrh w0, [x8, #44]
41 // 0x3000 + 0xc2e = 0x32ce = tcb + var4
42 // CHECK-NEXT: 21017c: add x8, x8, #3, lsl #12
43 // CHECK-NEXT: 210180: ldrb w0, [x8, #3118]
45 // CHECK-SYMS: 0000000000000c00 0 TLS GLOBAL DEFAULT 2 var0
46 // CHECK-SYMS-NEXT: 0000000000001810 4 TLS GLOBAL DEFAULT 2 var1
47 // CHECK-SYMS-NEXT: 0000000000002418 2 TLS GLOBAL DEFAULT 2 var2
48 // CHECK-SYMS-NEXT: 000000000000301c 1 TLS GLOBAL DEFAULT 2 var3
49 // CHECK-SYMS-NEXT: 0000000000003c1e 0 TLS GLOBAL DEFAULT 2 var4
51 .globl var0
52 .globl var1
53 .globl var2
54 .globl var3
55 .globl var4
56 .type var0,@object
57 .type var1,@object
58 .type var2,@object
59 .type var3,@object
61 .section .tbss,"awT",@nobits
62 .balign 16
63 .space 1024 * 3
64 var0:
65 .quad 0
66 .quad 0
67 .size var1, 16
68 .space 1024 * 3
69 var1:
70 .quad 0
71 .size var1, 8
72 .space 1024 * 3
73 var2:
74 .word 0
75 .size var1, 4
77 .space 1024 * 3
78 var3:
79 .hword 0
80 .size var2, 2
81 .space 1024 * 3
82 var4:
83 .byte 0
84 .size var3, 1
85 .space 1024 * 3