[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / Mips / hilo-addressing.s
blob720c7e256bb105055dcbe19981dff6205e122c71
1 # RUN: llvm-mc -show-encoding -triple mips-unknown-unknown %s \
2 # RUN: | FileCheck %s -check-prefix=CHECK-ENC
4 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s \
5 # RUN: | llvm-objdump -disassemble - | FileCheck %s -check-prefix=CHECK-INSTR
7 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s \
8 # RUN: | llvm-readobj -r | FileCheck %s -check-prefix=CHECK-REL
11 # Check that 1 is added to the high 16 bits if bit 15 of the low part is 1.
13 .equ addr, 0xdeadbeef
14 lui $4, %hi(addr)
15 lb $2, %lo(addr)($4)
16 # CHECK-ENC: # encoding: [0x3c,0x04,0xde,0xae]
17 # CHECK-ENC: # encoding: [0x80,0x82,0xbe,0xef]
20 # Check that assembler can handle %hi(label1 - label2) and %lo(label1 - label2)
21 # expressions.
23 $L1:
24 # Emit zeros so that difference between $L3 and $L1 is 0x30124 bytes.
25 .fill 0x30124-8
26 $L2:
27 lui $4, %hi($L3-$L1)
28 addiu $4, $4, %lo($L3-$L1)
29 # CHECK-INSTR: lui $4, 3
30 # CHECK-INSTR: addiu $4, $4, 292
32 $L3:
33 lui $5, %hi($L2-$L3)
34 lw $5, %lo($L2-$L3)($5)
35 # CHECK-INSTR: lui $5, 0
36 # CHECK-INSTR: lw $5, -8($5)
39 # Check that relocation isn't emitted for %hi(label1 - label2) and
40 # %lo(label1 - label2) expressions.
42 # CHECK-REL-NOT: R_MIPS