xref: /llvm-project/lld/test/ELF/mips-hilo-hi-only.s (revision 71e2ca6e32105b35aeadeab25010e8f999c47c23)
1# REQUIRES: mips
2# Check warning on orphaned R_MIPS_HI16 relocations.
3
4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5# RUN: ld.lld %t.o -o %t.exe 2>&1 | FileCheck -check-prefix=WARN %s
6# RUN: llvm-objdump -d -t --print-imm-hex --no-show-raw-insn %t.exe | FileCheck %s
7
8  .text
9  .globl  __start
10__start:
11  lui    $t0,%hi(__start+0x10000)
12  addi   $t0,$t0,%lo(_label)
13_label:
14  nop
15
16# WARN: can't find matching R_MIPS_LO16 relocation for R_MIPS_HI16
17
18# CHECK: SYMBOL TABLE:
19# CHECK: 00020{{0*}}[[VAL:[0-9a-f]+]] l .text   00000000 _label
20# CHECK: 00020{{.*}}                  g .text   00000000 __start
21
22# CHECK:      <__start>:
23# CHECK-NEXT:  lui    $8, 0x3
24#                         ^-- %hi(__start) w/o addend
25# CHECK-NEXT:  addi   $8, $8, 0x[[VAL]]
26#                             ^-- %lo(_label)
27