llvm-6502/test/MC/Mips/micromips-expansions.s
Zoran Jovanovic ef713e27b1 Added tests for microMIPS relocations 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193332 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 10:55:00 +00:00

58 lines
2.9 KiB
ArmAsm

# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding \
# RUN: -mcpu=mips32r2 -mattr=micromips | FileCheck %s
# Check that the assembler can handle the documented syntax
# for macro instructions
#------------------------------------------------------------------------------
# Load immediate instructions
#------------------------------------------------------------------------------
# CHECK: ori $5, $zero, 123 # encoding: [0xa0,0x50,0x7b,0x00]
# CHECK: addiu $6, $zero, -2345 # encoding: [0xc0,0x30,0xd7,0xf6]
# CHECK: lui $7, 1 # encoding: [0xa7,0x41,0x01,0x00]
# CHECK: ori $7, $7, 2 # encoding: [0xe7,0x50,0x02,0x00]
# CHECK: addiu $4, $zero, 20 # encoding: [0x80,0x30,0x14,0x00]
# CHECK: lui $7, 1 # encoding: [0xa7,0x41,0x01,0x00]
# CHECK: ori $7, $7, 2 # encoding: [0xe7,0x50,0x02,0x00]
# CHECK: addiu $4, $5, 20 # encoding: [0x85,0x30,0x14,0x00]
# CHECK: lui $7, 1 # encoding: [0xa7,0x41,0x01,0x00]
# CHECK: ori $7, $7, 2 # encoding: [0xe7,0x50,0x02,0x00]
# CHECK: addu $7, $7, $8 # encoding: [0x07,0x01,0x50,0x39]
# CHECK: lui $10, %hi(symbol) # encoding: [0xaa'A',0x41'A',0x00,0x00]
# CHECK: # fixup A - offset: 0,
# CHECK: value: symbol@ABS_HI,
# CHECK: kind: fixup_MICROMIPS_HI16
# CHECK: addu $10, $10, $4 # encoding: [0x8a,0x00,0x50,0x51]
# CHECK: lw $10, %lo(symbol)($10) # encoding: [0x4a'A',0xfd'A',0x00,0x00]
# CHECK: # fixup A - offset: 0,
# CHECK: value: symbol@ABS_LO,
# CHECK: kind: fixup_MICROMIPS_LO16
# CHECK: lui $1, %hi(symbol) # encoding: [0xa1'A',0x41'A',0x00,0x00]
# CHECK: # fixup A - offset: 0,
# CHECK: value: symbol@ABS_HI,
# CHECK: kind: fixup_MICROMIPS_HI16
# CHECK: addu $1, $1, $9 # encoding: [0x21,0x01,0x50,0x09]
# CHECK: sw $10, %lo(symbol)($1) # encoding: [0x41'A',0xf9'A',0x00,0x00]
# CHECK: # fixup A - offset: 0,
# CHECK: value: symbol@ABS_LO,
# CHECK: kind: fixup_MICROMIPS_LO16
# CHECK: lui $10, 10 # encoding: [0xaa,0x41,0x0a,0x00]
# CHECK: addu $10, $10, $4 # encoding: [0x8a,0x00,0x50,0x51]
# CHECK: lw $10, 123($10) # encoding: [0x4a,0xfd,0x7b,0x00]
# CHECK: lui $1, 2 # encoding: [0xa1,0x41,0x02,0x00]
# CHECK: addu $1, $1, $9 # encoding: [0x21,0x01,0x50,0x09]
# CHECK: sw $10, 57920($1) # encoding: [0x41,0xf9,0x40,0xe2]
li $5,123
li $6,-2345
li $7,65538
la $a0, 20
la $7,65538
la $a0, 20($a1)
la $7,65538($8)
lw $t2, symbol($a0)
sw $t2, symbol($t1)
lw $t2, 655483($a0)
sw $t2, 123456($t1)