aboutsummaryrefslogtreecommitdiff
path: root/test/MC/Mips/mips-jump-instructions.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/Mips/mips-jump-instructions.s')
-rw-r--r--test/MC/Mips/mips-jump-instructions.s40
1 files changed, 27 insertions, 13 deletions
diff --git a/test/MC/Mips/mips-jump-instructions.s b/test/MC/Mips/mips-jump-instructions.s
index bc2d720398..1dcb287738 100644
--- a/test/MC/Mips/mips-jump-instructions.s
+++ b/test/MC/Mips/mips-jump-instructions.s
@@ -1,30 +1,34 @@
-# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
+# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
+# RUN: FileCheck %s
# Check that the assembler can handle the documented syntax
# for jumps and branches.
# CHECK: .section __TEXT,__text,regular,pure_instructions
#------------------------------------------------------------------------------
# Branch instructions
#------------------------------------------------------------------------------
-# CHECK: b 1332 # encoding: [0x34,0x05,0x00,0x10]
+# CHECK: b 1332 # encoding: [0x4d,0x01,0x00,0x10]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: bc1f 1332 # encoding: [0x34,0x05,0x00,0x45]
+# CHECK: bc1f 1332 # encoding: [0x4d,0x01,0x00,0x45]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: bc1t 1332 # encoding: [0x34,0x05,0x01,0x45]
+# CHECK: bc1t 1332 # encoding: [0x4d,0x01,0x01,0x45]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: beq $9, $6, 1332 # encoding: [0x34,0x05,0x26,0x11]
+# CHECK: beq $9, $6, 1332 # encoding: [0x4d,0x01,0x26,0x11]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: bgez $6, 1332 # encoding: [0x34,0x05,0xc1,0x04]
+# CHECK: bgez $6, 1332 # encoding: [0x4d,0x01,0xc1,0x04]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: bgezal $6, 1332 # encoding: [0x34,0x05,0xd1,0x04]
+# CHECK: bgezal $6, 1332 # encoding: [0x4d,0x01,0xd1,0x04]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: bgtz $6, 1332 # encoding: [0x34,0x05,0xc0,0x1c]
+# CHECK: bgtz $6, 1332 # encoding: [0x4d,0x01,0xc0,0x1c]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: blez $6, 1332 # encoding: [0x34,0x05,0xc0,0x18]
+# CHECK: blez $6, 1332 # encoding: [0x4d,0x01,0xc0,0x18]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: bne $9, $6, 1332 # encoding: [0x34,0x05,0x26,0x15]
+# CHECK: bne $9, $6, 1332 # encoding: [0x4d,0x01,0x26,0x15]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: bal 1332 # encoding: [0x34,0x05,0x11,0x04]
+# CHECK: bal 1332 # encoding: [0x4d,0x01,0x11,0x04]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
+
+.set noreorder
+
b 1332
nop
bc1f 1332
@@ -50,9 +54,9 @@ end_of_code:
#------------------------------------------------------------------------------
# Jump instructions
#------------------------------------------------------------------------------
-# CHECK: j 1328 # encoding: [0x30,0x05,0x00,0x08]
+# CHECK: j 1328 # encoding: [0x4c,0x01,0x00,0x08]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
-# CHECK: jal 1328 # encoding: [0x30,0x05,0x00,0x0c]
+# CHECK: jal 1328 # encoding: [0x4c,0x01,0x00,0x0c]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: jalr $6 # encoding: [0x09,0xf8,0xc0,0x00]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
@@ -63,6 +67,11 @@ end_of_code:
# CHECK: jr $7 # encoding: [0x08,0x00,0xe0,0x00]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: jr $7 # encoding: [0x08,0x00,0xe0,0x00]
+# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
+# CHECK: jalr $25 # encoding: [0x09,0xf8,0x20,0x03]
+# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
+# CHECK: jalr $4, $25 # encoding: [0x09,0x20,0x20,0x03]
+# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
j 1328
@@ -78,3 +87,8 @@ end_of_code:
jr $7
nop
j $7
+ nop
+ jal $25
+ nop
+ jal $4,$25
+ nop