Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / mips-got16-relocatable.s
blob53f09d77500fe765aea8ebb32b7a2cdba02e0c1d
1 # REQUIRES: mips
2 # Check writing updated addend for R_MIPS_GOT16 relocation,
3 # when produce a relocatable output.
5 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -o %t.o %s
6 # RUN: ld.lld -r -o %t %t.o %t.o
7 # RUN: llvm-objdump --no-print-imm-hex -d -r --no-show-raw-insn %t | FileCheck --check-prefix=OBJ %s
8 # RUN: ld.lld -shared -o %t.so %t
9 # RUN: llvm-objdump -d -t --print-imm-hex --no-show-raw-insn %t.so \
10 # RUN: | FileCheck -check-prefix=SO %s
12 # OBJ: Disassembly of section .text:
13 # OBJ-EMPTY:
14 # OBJ-NEXT: <.text>:
15 # OBJ-NEXT: lw $25, 0($gp)
16 # OBJ-NEXT: 00000000: R_MIPS_GOT16 .data
17 # OBJ-NEXT: addiu $4, $25, 0
18 # OBJ-NEXT: 00000004: R_MIPS_LO16 .data
19 # OBJ: lw $25, 0($gp)
20 # OBJ-NEXT: 00000010: R_MIPS_GOT16 .data
21 # OBJ-NEXT: addiu $4, $25, 16
22 # OBJ-NEXT: 00000014: R_MIPS_LO16 .data
24 # SO: SYMBOL TABLE
25 # SO: {{0*}}[[D1:[0-9a-f]{1,4}]] l .data {{0+}} data
26 # SO: {{0*}}[[D2:[0-9a-f]{1,4}]] l .data {{0+}} data
28 # SO: Disassembly of section .text:
29 # SO-EMPTY:
30 # SO-NEXT: <.text>:
31 # SO-NEXT: lw $25, -0x7fe8($gp)
32 # SO-NEXT: addiu $4, $25, 0x[[D1]]
33 # SO: lw $25, -0x7fe8($gp)
34 # SO-NEXT: addiu $4, $25, 0x[[D2]]
36 .text
37 lw $t9, %got(.data)($gp)
38 addiu $a0, $t9, %lo(.data)
40 .data
41 data:
42 .word 0