49 lines · plain
1# RUN: llvm-mc -show-encoding -triple mips-unknown-unknown %s \2# RUN: | FileCheck %s -check-prefix=CHECK-ENC3 4# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s \5# RUN: | llvm-objdump --no-print-imm-hex -d - | FileCheck %s --check-prefix=CHECK-INSTR6 7# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s \8# RUN: | llvm-readobj -r - | FileCheck %s -check-prefix=CHECK-REL9 10# RUN: not llvm-mc -filetype=obj -triple=mipsel %s --defsym ERR=1 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:11 12# Check that 1 is added to the high 16 bits if bit 15 of the low part is 1.13 14 .equ addr, 0xdeadbeef15 lui $4, %hi(addr)16 lb $2, %lo(addr)($4)17# CHECK-ENC: # encoding: [0x3c,0x04,A,A]18# CHECK-ENC: # encoding: [0x80,0x82,A,A]19 20 21# Check that assembler can handle %hi(label1 - label2) and %lo(label1 - label2)22# expressions.23 24$L1:25 # Emit zeros so that difference between $L3 and $L1 is 0x30124 bytes.26 .fill 0x30124-827$L2:28 lui $4, %hi($L3-$L1)29 addiu $4, $4, %lo($L3-$L1)30# CHECK-INSTR: lui $4, 331# CHECK-INSTR: addiu $4, $4, 29232 33$L3:34 lui $5, %hi($L2-$L3)35 lw $5, %lo($L2-$L3)($5)36# CHECK-INSTR: lui $5, 037# CHECK-INSTR: lw $5, -8($5)38 39 40# Check that relocation isn't emitted for %hi(label1 - label2) and41# %lo(label1 - label2) expressions.42 43# CHECK-REL-NOT: R_MIPS44 45.ifdef ERR46# ERR: <unknown>:0: error: expected relocatable expression47lui $4, %hi(und-$L3)48.endif49