1 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
3 # Check that the assembler can handle the documented syntax
4 # for jumps and branches.
5 # CHECK: .section __TEXT,__text,regular,pure_instructions
6 #------------------------------------------------------------------------------
8 #------------------------------------------------------------------------------
9 # CHECK: b 1332 # encoding: [0x4d,0x01,0x00,0x10]
10 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
11 # CHECK: bc1f 1332 # encoding: [0x4d,0x01,0x00,0x45]
12 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
13 # CHECK: bc1t 1332 # encoding: [0x4d,0x01,0x01,0x45]
14 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
15 # CHECK: beq $9, $6, 1332 # encoding: [0x4d,0x01,0x26,0x11]
16 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
17 # CHECK: bgez $6, 1332 # encoding: [0x4d,0x01,0xc1,0x04]
18 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
19 # CHECK: bgezal $6, 1332 # encoding: [0x4d,0x01,0xd1,0x04]
20 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
21 # CHECK: bgtz $6, 1332 # encoding: [0x4d,0x01,0xc0,0x1c]
22 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
23 # CHECK: blez $6, 1332 # encoding: [0x4d,0x01,0xc0,0x18]
24 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
25 # CHECK: bne $9, $6, 1332 # encoding: [0x4d,0x01,0x26,0x15]
26 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
27 # CHECK: bal 1332 # encoding: [0x4d,0x01,0x11,0x04]
28 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
54 #------------------------------------------------------------------------------
56 #------------------------------------------------------------------------------
57 # CHECK: j 1328 # encoding: [0x4c,0x01,0x00,0x08]
58 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
59 # CHECK: jal 1328 # encoding: [0x4c,0x01,0x00,0x0c]
60 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
61 # CHECK: jalr $6 # encoding: [0x09,0xf8,0xc0,0x00]
62 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
63 # CHECK: jalr $25 # encoding: [0x09,0xf8,0x20,0x03]
64 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
65 # CHECK: jalr $10, $11 # encoding: [0x09,0x50,0x60,0x01]
66 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
67 # CHECK: jr $7 # encoding: [0x08,0x00,0xe0,0x00]
68 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
69 # CHECK: jr $7 # encoding: [0x08,0x00,0xe0,0x00]
70 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
71 # CHECK: jalr $25 # encoding: [0x09,0xf8,0x20,0x03]
72 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
73 # CHECK: jalr $4, $25 # encoding: [0x09,0x20,0x20,0x03]
74 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]