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:
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
20 # OBJ-NEXT: 00000010: R_MIPS_GOT16 .data
21 # OBJ-NEXT: addiu $4, $25, 16
22 # OBJ-NEXT: 00000014: R_MIPS_LO16 .data
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:
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]]
37 lw $t9
, %got
(.data)($gp)
38 addiu $a0
, $t9
, %lo
(.data)