[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / ppc64-tls-pcrel-le.s
blob683a3260c1e5bb35e94d5c8a666b43e206c63df0
1 # REQUIRES: ppc
2 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL
5 # RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t | FileCheck %s
7 # RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o
8 # RUN: ld.lld %t.o -o %t
9 # RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL
10 # RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t | FileCheck %s
12 ## This test checks the LLD implementation of the Local Exec TLS model
13 ## when using prefixed instructions like paddi.
15 # SYMBOL: Symbol table '.symtab' contains 6 entries:
16 # SYMBOL: 0000000000000000 0 TLS LOCAL DEFAULT 2 x
17 # SYMBOL-NEXT: 0000000000000004 0 TLS LOCAL DEFAULT 2 y
18 # SYMBOL-NEXT: 0000000000000008 0 TLS LOCAL DEFAULT 2 z
20 # CHECK-LABEL: <LocalExecAddr>:
21 # CHECK: paddi 3, 13, -28672, 0
22 # CHECK-NEXT: paddi 3, 13, -28668, 0
23 # CHECK-NEXT: paddi 3, 13, -28652, 0
24 # CHECK-NEXT: blr
26 # CHECK-LABEL: <LocalExecVal>:
27 # CHECK: paddi 3, 13, -28672, 0
28 # CHECK-NEXT: lwz 3, 0(3)
29 # CHECK-NEXT: paddi 3, 13, -28668, 0
30 # CHECK-NEXT: lwz 3, 0(3)
31 # CHECK-NEXT: paddi 3, 13, -28652, 0
32 # CHECK-NEXT: lwz 3, 0(3)
33 # CHECK-NEXT: blr
35 LocalExecAddr:
36 paddi 3, 13, x@TPREL, 0
37 paddi 3, 13, y@TPREL, 0
38 paddi 3, 13, z@TPREL+12, 0
39 blr
41 LocalExecVal:
42 paddi 3, 13, x@TPREL, 0
43 lwz 3, 0(3)
44 paddi 3, 13, y@TPREL, 0
45 lwz 3, 0(3)
46 paddi 3, 13, z@TPREL+12, 0
47 lwz 3, 0(3)
48 blr
50 .section .tbss, "awT", @nobits
52 .long 0
54 .long 0
56 .space 20