[mips] Fix InstAlias of XOR and OR macros. Set EmitAlias flag and change
[oota-llvm.git] / test / MC / Mips / mips-jump-instructions.s
1 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
2 # RUN: FileCheck %s
3 # Check that the assembler can handle the documented syntax
4 # for jumps and branches.
5 #------------------------------------------------------------------------------
6 # Branch instructions
7 #------------------------------------------------------------------------------
8 # CHECK:   b 1332                 # encoding: [0x4d,0x01,0x00,0x10]
9 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
10 # CHECK:   bc1f 1332              # encoding: [0x4d,0x01,0x00,0x45]
11 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
12 # CHECK:   bc1t 1332              # encoding: [0x4d,0x01,0x01,0x45]
13 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
14 # CHECK:   beq $9, $6, 1332       # encoding: [0x4d,0x01,0x26,0x11]
15 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
16 # CHECK:   bgez $6, 1332          # encoding: [0x4d,0x01,0xc1,0x04]
17 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
18 # CHECK:   bgezal $6, 1332        # encoding: [0x4d,0x01,0xd1,0x04]
19 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
20 # CHECK:   bgtz $6, 1332          # encoding: [0x4d,0x01,0xc0,0x1c]
21 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
22 # CHECK:   blez $6, 1332          # encoding: [0x4d,0x01,0xc0,0x18]
23 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
24 # CHECK:   bne $9, $6, 1332       # encoding: [0x4d,0x01,0x26,0x15]
25 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
26 # CHECK:   bal     1332           # encoding: [0x4d,0x01,0x11,0x04]
27 # CHECK:   nop                    # encoding: [0x00,0x00,0x00,0x00]
28
29 .set noreorder
30
31          b 1332
32          nop
33          bc1f 1332
34          nop
35          bc1t 1332
36          nop
37          beq $9,$6,1332
38          nop
39          bgez $6,1332
40          nop
41          bgezal $6,1332
42          nop
43          bgtz $6,1332
44          nop
45          blez $6,1332
46          nop
47          bne $9,$6,1332
48          nop
49          bal 1332
50          nop
51
52 end_of_code:
53 #------------------------------------------------------------------------------
54 # Jump instructions
55 #------------------------------------------------------------------------------
56 # CHECK:   j 1328               # encoding: [0x4c,0x01,0x00,0x08]
57 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
58 # CHECK:   jal 1328             # encoding: [0x4c,0x01,0x00,0x0c]
59 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
60 # CHECK:   jalr $6              # encoding: [0x09,0xf8,0xc0,0x00]
61 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
62 # CHECK:   jalr $25             # encoding: [0x09,0xf8,0x20,0x03]
63 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
64 # CHECK:   jalr $10, $11        # encoding: [0x09,0x50,0x60,0x01]
65 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
66 # CHECK:   jr $7                # encoding: [0x08,0x00,0xe0,0x00]
67 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
68 # CHECK:   jr $7                # encoding: [0x08,0x00,0xe0,0x00]
69 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
70 # CHECK:   jalr  $25            # encoding: [0x09,0xf8,0x20,0x03]
71 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
72 # CHECK:   jalr  $4, $25        # encoding: [0x09,0x20,0x20,0x03]
73 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
74
75
76    j 1328
77    nop
78    jal 1328
79    nop
80    jalr $6
81    nop
82    jalr $31, $25
83    nop
84    jalr $10, $11
85    nop
86    jr $7
87    nop
88    j $7
89    nop
90    jal  $25
91    nop
92    jal  $4,$25
93    nop