Fix and clean up tests. Un-XFAIL.
[oota-llvm.git] / test / MC / ARM / basic-thumb-instructions.s
index 54d353e0c3cc831b8944a36e6a2a2e0c8b217886..0fa52b098746505cdc37ef468fef34da26f2fe77 100644 (file)
@@ -1,4 +1,9 @@
+@---
+@ Run these test in both Thumb1 and Thumb2 modes, as all of the encodings
+@ should be valid, and parse the same, in both.
+@---
 @ RUN: llvm-mc -triple=thumbv6-apple-darwin -show-encoding < %s | FileCheck %s
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -show-encoding < %s | FileCheck %s
   .syntax unified
   .globl _func
 
@@ -26,11 +31,13 @@ _func:
 @ ADD (immediate)
 @------------------------------------------------------------------------------
         adds r1, r2, #3
+@ When Rd is not explicitly specified, encoding T2 is preferred even though
+@ the literal is in the range [0,7] which would allow encoding T1.
         adds r2, #3
         adds r2, #8
 
 @ CHECK: adds  r1, r2, #3              @ encoding: [0xd1,0x1c]
-@ CHECK: adds  r2, r2, #3              @ encoding: [0xd2,0x1c]
+@ CHECK: adds  r2, #3                  @ encoding: [0x03,0x32]
 @ CHECK: adds  r2, #8                  @ encoding: [0x08,0x32]
 
 
@@ -107,6 +114,8 @@ _func:
         beq _bar
         b       #1838
         b       #-420
+        beq     #336
+        beq     #160
 
 @ CHECK: b     _baz                    @ encoding: [A,0xe0'A']
              @   fixup A - offset: 0, value: _baz, kind: fixup_arm_thumb_br
@@ -114,6 +123,17 @@ _func:
              @   fixup A - offset: 0, value: _bar, kind: fixup_arm_thumb_bcc
 @ CHECK: b       #1838                   @ encoding: [0x97,0xe3]
 @ CHECK: b       #-420                   @ encoding: [0x2e,0xe7]
+@ CHECK: beq     #336                    @ encoding: [0xa8,0xd0]
+@ CHECK: beq     #160                    @ encoding: [0x50,0xd0]
+
+@------------------------------------------------------------------------------
+@ BL/BLX
+@------------------------------------------------------------------------------
+        blx     #884800
+        blx     #1769600
+
+@ CHECK: blx     #884800                 @ encoding: [0xd8,0xf0,0x20,0xe8]
+@ CHECK: blx     #1769600                @ encoding: [0xb0,0xf1,0x40,0xe8]
 
 @------------------------------------------------------------------------------
 @ BICS
@@ -373,15 +393,6 @@ _func:
 
 @ CHECK: rsbs  r3, r4, #0              @ encoding: [0x63,0x42]
 
-
-@------------------------------------------------------------------------------
-@ NOP
-@------------------------------------------------------------------------------
-        nop
-
-@ CHECK: nop                            @ encoding: [0xc0,0x46]
-
-
 @------------------------------------------------------------------------------
 @ ORR
 @------------------------------------------------------------------------------