3 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
4 # RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=INPUT-REL %s
6 # RUN: ld.lld -shared %t.o -o %t.so
7 # RUN: llvm-readobj -d -r %t.so | FileCheck --check-prefix=IE-REL %s
8 # RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck --check-prefix=IE %s
10 # RUN: ld.lld %t.o -o %t
11 # RUN: llvm-readelf -r %t | FileCheck --check-prefix=NOREL %s
12 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=LE %s
14 # RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o
15 # RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=INPUT-REL %s
17 # RUN: ld.lld -shared %t.o -o %t.so
18 # RUN: llvm-readobj -d -r %t.so | FileCheck --check-prefix=IE-REL %s
19 # RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck --check-prefix=IE %s
21 # RUN: ld.lld %t.o -o %t
22 # RUN: llvm-readelf -r %t | FileCheck --check-prefix=NOREL %s
23 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=LE %s
25 # IE-REL: FLAGS STATIC_TLS
27 # IE-REL-NEXT: 0x205A8 R_PPC64_TPREL64 c 0x0
28 # IE-REL-NEXT: 0x205B0 R_PPC64_TPREL64 s 0x0
29 # IE-REL-NEXT: 0x205B8 R_PPC64_TPREL64 i 0x0
30 # IE-REL-NEXT: 0x205C0 R_PPC64_TPREL64 l 0x0
31 # IE-REL-NEXT: 0x205C8 R_PPC64_TPREL64 f 0x0
32 # IE-REL-NEXT: 0x205D0 R_PPC64_TPREL64 d 0x0
35 # INPUT-REL: R_PPC64_GOT_TPREL16_HA c 0x0
36 # INPUT-REL: R_PPC64_GOT_TPREL16_LO_DS c 0x0
37 # INPUT-REL: R_PPC64_TLS c 0x0
38 ## &.got[1] - .TOC. = -32760
40 # IE-NEXT: addis 3, 2, 0
41 # IE-NEXT: ld 3, -32760(3)
42 # IE-NEXT: lbzx 3, 3, 13
45 # LE-NEXT: addis 3, 13, 0
46 # LE-NEXT: lbz 3, -28672(3)
48 addis 3, 2, c@got@tprel@ha
49 ld 3, c@got@tprel@
l(3)
52 # INPUT-REL: R_PPC64_GOT_TPREL16_HA s 0x0
53 # INPUT-REL: R_PPC64_GOT_TPREL16_LO_DS s 0x0
54 # INPUT-REL: R_PPC64_TLS s 0x0
55 ## &.got[2] - .TOC. = -32752
57 # IE-NEXT: addis 3, 2, 0
58 # IE-NEXT: ld 3, -32752(3)
59 # IE-NEXT: lhzx 3, 3, 13
62 # LE-NEXT: addis 3, 13, 0
63 # LE-NEXT: lhz 3, -28670(3)
65 addis 3, 2, s@got@tprel@ha
66 ld 3, s@got@tprel@
l(3)
69 # INPUT-REL: R_PPC64_GOT_TPREL16_HA i 0x0
70 # INPUT-REL: R_PPC64_GOT_TPREL16_LO_DS i 0x0
71 # INPUT-REL: R_PPC64_TLS i 0x0
72 ## &.got[3] - .TOC. = -32744
74 # IE-NEXT: addis 3, 2, 0
75 # IE-NEXT: ld 3, -32744(3)
76 # IE-NEXT: lwzx 3, 3, 13
79 # LE-NEXT: addis 3, 13, 0
80 # LE-NEXT: lwz 3, -28668(3)
82 addis 3, 2, i@got@tprel@ha
83 ld 3, i@got@tprel@
l(3)
86 # INPUT-REL: R_PPC64_GOT_TPREL16_HA l 0x0
87 # INPUT-REL: R_PPC64_GOT_TPREL16_LO_DS l 0x0
88 # INPUT-REL: R_PPC64_TLS l 0x0
89 ## &.got[4] - .TOC. = -32736
91 # IE-NEXT: addis 3, 2, 0
92 # IE-NEXT: ld 3, -32736(3)
93 # IE-NEXT: ldx 3, 3, 13
96 # LE-NEXT: addis 3, 13, 0
97 # LE-NEXT: ld 3, -28664(3)
99 addis 3, 2, l@got@tprel@ha
100 ld 3, l@got@tprel@
l(3)
105 # LE-NEXT: addis 4, 13, 0
106 # LE-NEXT: stb 3, -28672(4)
108 addis 4, 2, c@got@tprel@ha
109 ld 4, c@got@tprel@
l(4)
115 # LE-NEXT: addis 4, 13, 0
116 # LE-NEXT: sth 3, -28670(4)
118 addis 4, 2, s@got@tprel@ha
119 ld 4, s@got@tprel@
l(4)
125 # LE-NEXT: addis 4, 13, 0
126 # LE-NEXT: stw 3, -28668(4)
128 addis 4, 2, i@got@tprel@ha
129 ld 4, i@got@tprel@
l(4)
134 # LE-NEXT: addis 4, 13, 0
135 # LE-NEXT: std 3, -28664(4)
137 addis 4, 2, l@got@tprel@ha
138 ld 4, l@got@tprel@
l(4)
143 # LE-NEXT: addis 3, 13, 0
144 # LE-NEXT: addi 3, 3, -28668
146 addis 3, 2, i@got@tprel@ha
147 ld 3, i@got@tprel@
l(3)
150 # LE-LABEL: <test_ds>:
151 # LE-NEXT: addis 4, 13, 0
152 # LE-NEXT: std 3, -28664(4)
157 # LE-LABEL: <test_lhax>:
159 # LE-NEXT: addis 3, 13, 0
160 # LE-NEXT: lha 3, -28670(3)
162 addis 3, 2, s@got@tprel@ha
163 ld 3, s@got@tprel@
l(3)
166 # LE-LABEL: <test_lwax>:
168 # LE-NEXT: addis 3, 13, 0
169 # LE-NEXT: lwa 3, -28668(3)
171 addis 3, 2, i@got@tprel@ha
172 ld 3, i@got@tprel@
l(3)
175 # LE-LABEL: <test_lfsx>:
177 # LE-NEXT: addis 3, 13, 0
178 # LE-NEXT: lfs 3, -28656(3)
180 addis 3, 2, f@got@tprel@ha
181 ld 3, f@got@tprel@
l(3)
184 # LE-LABEL: <test_lfdx>:
186 # LE-NEXT: addis 3, 13, 0
187 # LE-NEXT: lfd 3, -28648(3)
189 addis 3, 2, d@got@tprel@ha
190 ld 3, d@got@tprel@
l(3)
193 # LE-LABEL: <test_stfsx>:
195 # LE-NEXT: addis 4, 13, 0
196 # LE-NEXT: stfs 3, -28656(4)
198 addis 4, 2, f@got@tprel@ha
199 ld 4, f@got@tprel@
l(4)
202 # LE-LABEL: <test_stfdx>:
204 # LE-NEXT: addis 4, 13, 0
205 # LE-NEXT: stfd 3, -28648(4)
207 addis 4, 2, d@got@tprel@ha
208 ld 4, d@got@tprel@
l(4)
211 # NOREL: There are no relocations in this file.
213 .section .tdata,"awT",@progbits
214 .globl c, s, i, l, f, d