1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/MC/Mips/user-macro-argument-separation.s
Scott Egerton 1867a0f5e4 [MC] Fixed parsing of macro arguments where expressions with spaces are present.
Summary:
Fixed an issue for mips with an instruction such as 'sdc1 $f1, 272 +8(a0)' which has a space between '272' and '+'. The parser would then parse '272' and '+8' as two arguments instead of a single expression resulting in one too many arguments in the pseudo instruction.
The reason that the test case has been changed is so that the expected
output matches the output of the GNU assembler.

Reviewers: vkalintiris, dsanders

Subscribers: dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D13592

llvm-svn: 260521
2016-02-11 13:48:49 +00:00

41 lines
1.8 KiB
ArmAsm

# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
# RUN: FileCheck %s
# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
# RUN: FileCheck %s
# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \
# RUN: FileCheck %s
# Check that the IAS expands macro instructions in the same way as GAS
.extern sym
# imm and rs are deliberately swapped to test whitespace separated arguments.
.macro EX2 insn, rd, imm, rs
.ex\@: \insn \rd, \rs, \imm
.endm
.option pic0
EX2 addiu $2, 1 $3 # CHECK: addiu $2, $3, 1
EX2 addiu $2, ~1 $3 # CHECK: addiu $2, $3, -2
EX2 addiu $2, ~ 1 $3 # CHECK: addiu $2, $3, -2
EX2 addiu $2, 1+1 $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1+ 1 $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1 +1 $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1 + 1 $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1+~1 $3 # CHECK: addiu $2, $3, -1
EX2 addiu $2, 1+~ 1 $3 # CHECK: addiu $2, $3, -1
EX2 addiu $2, 1+ ~1 $3 # CHECK: addiu $2, $3, -1
EX2 addiu $2, 1 +~1 $3 # CHECK: addiu $2, $3, -1
EX2 addiu $2, 1 +~ 1 $3 # CHECK: addiu $2, $3, -1
EX2 addiu $2, 1 + ~1 $3 # CHECK: addiu $2, $3, -1
EX2 addiu $2, 1 + ~ 1 $3 # CHECK: addiu $2, $3, -1
EX2 addiu $2, 1+(1) $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1 +(1) $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1+ (1) $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1 + (1) $3 # CHECK: addiu $2, $3, 2
EX2 addiu $2, 1+(1)+1 $3 # CHECK: addiu $2, $3, 3
EX2 addiu $2, 1 +(1)+1 $3 # CHECK: addiu $2, $3, 3
EX2 addiu $2, 1+ (1)+1 $3 # CHECK: addiu $2, $3, 3
EX2 addiu $2, 1 + (1)+1 $3 # CHECK: addiu $2, $3, 3
nop # CHECK: nop