reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
# 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