xref: /llvm-project/lld/test/ELF/systemz-tls-le.s (revision fe3406e349884e4ef61480dd0607f1e237102c74)
1# REQUIRES: systemz
2# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
3
4# RUN: ld.lld %t.o -o %t
5# RUN: llvm-readelf -r %t | FileCheck --check-prefix=NOREL %s
6# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=LE %s
7# RUN: llvm-objdump --section .data.rel.ro --full-contents %t | FileCheck --check-prefix=LE-DATA %s
8
9# NOREL: no relocations
10
11## TP offset for a is at 0x1002200
12# LE:      lgrl    %r1, 0x1002200
13# LE-NEXT: lgf     %r1, 0(%r1,%r7)
14
15## TP offset for b is at 0x1002208
16# LE-NEXT: lgrl    %r1, 0x1002208
17# LE-NEXT: lgf     %r1, 0(%r1,%r7)
18
19## TP offset for c is at 0x1002210
20# LE-NEXT: lgrl    %r1, 0x1002210
21# LE-NEXT: lgf     %r1, 0(%r1,%r7)
22
23## TP offsets:
24# a: -8
25# b: -4
26# c: 0
27# LE-DATA: 1002200 ffffffff fffffff8 ffffffff fffffffc
28# LE-DATA: 1002210 00000000 00000000
29
30ear     %r7,%a0
31sllg    %r7,%r1,32
32ear     %r7,%a1
33
34lgrl    %r1, .LC0
35lgf     %r1,0(%r1,%r7)
36
37lgrl    %r1, .LC1
38lgf     %r1,0(%r1,%r7)
39
40lgrl    %r1, .LC2
41lgf     %r1,0(%r1,%r7)
42
43        .section        .data.rel.ro,"aw"
44        .align  8
45.LC0:
46        .quad   a@ntpoff
47.LC1:
48        .quad   b@ntpoff
49.LC2:
50        .quad   c@ntpoff
51
52	.section .tbss
53	.globl a
54	.globl b
55	.globl c
56	.zero 8
57a:
58	.zero 4
59b:
60	.zero 4
61c:
62