1 # RUN: llvm-mc -filetype=obj -triple=mips64el-unknown-linux -mcpu=mips64r2 %s \
2 # RUN: | llvm-objdump -disassemble - | FileCheck %s
4 # RUN: llvm-mc -filetype=obj -triple=mips64el-unknown-linux -mcpu=mips64r2 %s \
5 # RUN: | llvm-readobj -r | FileCheck %s -check-prefix=CHECK-REL
8 # Test that R_MIPS_HIGHER and R_MIPS_HIGHEST relocations are created. By using
9 # NEXT we also test that none of the expressions from the test2 generates
15 lui $
5, %highest
(func
)
16 daddiu $
5, $
5, %higher
(func
)
18 # CHECK-REL: Relocations [
20 # CHECK-REL-NEXT: 0x{{[0-9,A-F]+}} R_MIPS_HIGHEST
21 # CHECK-REL-NEXT: 0x{{[0-9,A-F]+}} R_MIPS_HIGHER
25 # Test the calculation of %higher and %highest:
26 # ((x + 0x80008000) >> 32) & 0xffff (higher)
27 # ((x + 0x800080008000) >> 48) & 0xffff (highest).
32 # Check the case where relocations are not modified by adding +1. The constant
33 # is chosen so that it is just below the value that triggers the addition of +1
36 lui $
6, %highest
($L2-$L1+
0x300047FFF7FF7)
37 daddiu $
6, $
6, %higher
($L2-$L1+
0x300047FFF7FF7)
40 # CHECK: daddiu $6, $6, 4
43 # Check the case where %higher is modified by adding +1.
44 lui $
7, %highest
($L2-$L1+
0x300047FFF7FF8)
45 ld $
7, %higher
($L2-$L1+
0x300047FFF7FF8)($
7)
50 # Check the case where both %higher and %highest are modified by adding +1.
51 lui $
8, %highest
(0x37FFF7FFF8000)
52 ld $
8, %higher
(0x37FFF7FFF8000)($
8)
54 # CHECK: ld $8, -32768($8)