Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / mips-tls-hilo.s
blob6fd2033aac41427042dc6bd9423e4632f93eacce
1 # REQUIRES: mips
2 # Check MIPS R_MIPS_TLS_DTPREL_HI16/LO16 and R_MIPS_TLS_TPREL_HI16/LO16
3 # relocations handling.
5 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
6 # RUN: ld.lld %t.o -o %t.exe
7 # RUN: llvm-objdump --no-print-imm-hex -d -t --no-show-raw-insn %t.exe | FileCheck --check-prefix=DIS %s
8 # RUN: llvm-readobj -r -A %t.exe | FileCheck %s
10 # RUN: not ld.lld %t.o -shared -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
12 # ERR: error: relocation R_MIPS_TLS_TPREL_HI16 against loc0 cannot be used with -shared
13 # ERR: error: relocation R_MIPS_TLS_TPREL_LO16 against loc0 cannot be used with -shared
15 # DIS: 00000000 l .tdata 00000000 loc0
17 # DIS: <__start>:
18 # DIS-NEXT: addiu $2, $3, 0
19 # ^-- %hi(loc0 - .tdata - 0x8000)
20 # DIS-NEXT: addiu $2, $3, -32768
21 # ^-- %lo(loc0 - .tdata - 0x8000)
22 # DIS-NEXT: addiu $2, $3, 0
23 # ^-- %hi(loc0 - .tdata - 0x7000)
24 # DIS-NEXT: addiu $2, $3, -28672
25 # ^-- %lo(loc0 - .tdata - 0x7000)
27 # CHECK: Relocations [
28 # CHECK-NEXT: ]
29 # CHECK-NOT: Primary GOT
31 # SO: Relocations [
32 # SO-NEXT: ]
33 # SO: Primary GOT {
34 # SO: Local entries [
35 # SO-NEXT: ]
36 # SO-NEXT: Global entries [
37 # SO-NEXT: ]
38 # SO-NEXT: Number of TLS and multi-GOT entries: 0
39 # SO-NEXT: }
41 .text
42 .globl __start
43 .type __start,@function
44 __start:
45 addiu $2, $3, %dtprel_hi(loc0) # R_MIPS_TLS_DTPREL_HI16
46 addiu $2, $3, %dtprel_lo(loc0) # R_MIPS_TLS_DTPREL_LO16
47 addiu $2, $3, %tprel_hi(loc0) # R_MIPS_TLS_TPREL_HI16
48 addiu $2, $3, %tprel_lo(loc0) # R_MIPS_TLS_TPREL_LO16
50 .section .tdata,"awT",%progbits
51 loc0:
52 .word 0