Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / mips-tls-static.s
blob1360664707280666877f0261df30fce0841cfa55
1 # REQUIRES: mips
2 # Check handling TLS related relocations and symbols when linking
3 # a static executable.
5 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t
6 # RUN: ld.lld -static %t -o %t.exe
7 # RUN: llvm-objdump -s -t %t.exe | FileCheck %s
9 # CHECK: SYMBOL TABLE:
10 # CHECK: 00000000 g .tdata 00000000 tls1
11 # CHECK: [[TGA:[0-9a-f]+]] g .text 00000000 __tls_get_addr
13 # CHECK: Contents of section .data:
14 # CHECK-NEXT: {{.*}} [[TGA]] ffff8004 ffff9004
15 # CHECK: Contents of section .got:
16 # CHECK-NEXT: {{.*}} 00000000 80000000 ffff9000 00000001
17 # CHECK-NEXT: {{.*}} ffff8000 00000001 00000000
19 .text
20 .global __start
21 __start:
22 addiu $2, $3, %tlsgd(tls1) # R_MIPS_TLS_GD
23 addiu $2, $3, %tlsldm(tls2) # R_MIPS_TLS_LDM
24 addiu $2, $3, %gottprel(tls1) # R_MIPS_TLS_GOTTPREL
26 .global __tls_get_addr
27 __tls_get_addr:
28 nop
30 .data
31 loc:
32 .word __tls_get_addr
33 .dtprelword tls1+4 # R_MIPS_TLS_DTPREL32
34 .tprelword tls1+4 # R_MIPS_TLS_TPREL32
36 .section .tdata,"awT",%progbits
37 .global tls1
38 tls1:
39 .word __tls_get_addr
40 tls2:
41 .word 0