forked from OSchip/llvm-project
69 lines
2.2 KiB
Plaintext
69 lines
2.2 KiB
Plaintext
# REQUIRES: mips
|
|
|
|
# Check handling of HI16 and LO16 relocations for regular symbol.
|
|
#
|
|
# R_MIPS_HI16: (AHL + S) - (short)(AHL + S)
|
|
# R_MIPS_LO16: AHL + S
|
|
# where AHL = (AHI << 16) + ALO
|
|
#
|
|
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t-obj %s
|
|
# RUN: lld -flavor gnu -target mipsel -e glob1 -o %t-exe %t-obj
|
|
# RUN: llvm-objdump -t -disassemble %t-exe | FileCheck %s
|
|
|
|
# CHECK: Disassembly of section .text:
|
|
# CHECK: glob1:
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 81 01 08 85 lh $8, 385($8)
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 7f 01 08 85 lh $8, 383($8)
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 7f 03 08 85 lh $8, 895($8)
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 81 ff 08 85 lh $8, -127($8)
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 42 00 08 3c lui $8, 66
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 7f 01 08 85 lh $8, 383($8)
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 3e 00 08 3c lui $8, 62
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 81 01 08 85 lh $8, 385($8)
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 40 02 08 3c lui $8, 576
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 7f 01 08 85 lh $8, 383($8)
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 40 fe 08 3c lui $8, 65088
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 81 01 08 85 lh $8, 385($8)
|
|
|
|
# CHECK: SYMBOL TABLE:
|
|
# CHECK: {{[0-9a-f]+}} g F .text 00000040 glob1
|
|
# CHECK: {{[0-9a-f]+}} g F .text 00000004 glob2
|
|
|
|
.global glob1
|
|
.ent glob1
|
|
glob1:
|
|
lui $t0,%hi(glob2+0x1)
|
|
lh $t0,%lo(glob2+0x1)($t0)
|
|
|
|
lui $t0,%hi(glob2+(-0x1))
|
|
lh $t0,%lo(glob2+(-0x1))($t0)
|
|
|
|
lui $t0,%hi(glob2+0x1ff)
|
|
lh $t0,%lo(glob2+0x1ff)($t0)
|
|
|
|
lui $t0,%hi(glob2+(-0x1ff))
|
|
lh $t0,%lo(glob2+(-0x1ff))($t0)
|
|
|
|
lui $t0,%hi(glob2+0x1ffff)
|
|
lh $t0,%lo(glob2+0x1ffff)($t0)
|
|
|
|
lui $t0,%hi(glob2+(-0x1ffff))
|
|
lh $t0,%lo(glob2+(-0x1ffff))($t0)
|
|
|
|
lui $t0,%hi(glob2+0x1ffffff) # truncate
|
|
lh $t0,%lo(glob2+0x1ffffff)($t0)
|
|
|
|
lui $t0,%hi(glob2+(-0x1ffffff)) # truncate
|
|
lh $t0,%lo(glob2+(-0x1ffffff))($t0)
|
|
.end glob1
|
|
|
|
.global glob2
|
|
.ent glob2
|
|
glob2:
|
|
nop
|
|
.end glob2
|