summaryrefslogtreecommitdiff
path: root/test/MC/ARM
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-10-07 11:10:47 +0000
committerTim Northover <tnorthover@apple.com>2013-10-07 11:10:47 +0000
commitcf3e4cb29a5fd485f11354060bb7a99e8cfdaf09 (patch)
tree9d2dde8a3a23df35f617e28ab1e8a04e099f2620 /test/MC/ARM
parentae06a63be5a1279739e0c8a2006e72f4bc687d57 (diff)
downloadllvm-cf3e4cb29a5fd485f11354060bb7a99e8cfdaf09.tar.gz
llvm-cf3e4cb29a5fd485f11354060bb7a99e8cfdaf09.tar.bz2
llvm-cf3e4cb29a5fd485f11354060bb7a99e8cfdaf09.tar.xz
ARM: allow cortex-m0 to use hint instructions
The hint instructions ("nop", "yield", etc) are mostly Thumb2-only, but have been ported across to the v6M architecture. Fortunately, v6M seems to sit nicely between v6 (thumb-1 only) and v6T2, so we can add a feature for it fairly easily. rdar://problem/15144406 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/ARM')
-rw-r--r--test/MC/ARM/thumb-diagnostics.s6
-rw-r--r--test/MC/ARM/thumb-hints.s34
-rw-r--r--test/MC/ARM/thumb-nop.s9
3 files changed, 37 insertions, 12 deletions
diff --git a/test/MC/ARM/thumb-diagnostics.s b/test/MC/ARM/thumb-diagnostics.s
index 8f86323e25..a82d497cea 100644
--- a/test/MC/ARM/thumb-diagnostics.s
+++ b/test/MC/ARM/thumb-diagnostics.s
@@ -179,13 +179,13 @@ error: invalid operand for instruction
wfi
yield
-@ CHECK-ERRORS: error: instruction requires: thumb2
+@ CHECK-ERRORS: error: instruction requires: armv6m or armv6t2
@ CHECK-ERRORS: wfe
@ CHECK-ERRORS: ^
-@ CHECK-ERRORS: error: instruction requires: thumb2
+@ CHECK-ERRORS: error: instruction requires: armv6m or armv6t2
@ CHECK-ERRORS: wfi
@ CHECK-ERRORS: ^
-@ CHECK-ERRORS: error: instruction requires: thumb2
+@ CHECK-ERRORS: error: instruction requires: armv6m or armv6t2
@ CHECK-ERRORS: yield
@ CHECK-ERRORS: ^
diff --git a/test/MC/ARM/thumb-hints.s b/test/MC/ARM/thumb-hints.s
new file mode 100644
index 0000000000..73e83621a9
--- /dev/null
+++ b/test/MC/ARM/thumb-hints.s
@@ -0,0 +1,34 @@
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -show-encoding < %s | FileCheck %s
+@ RUN: llvm-mc -triple=thumbv6-apple-darwin -mcpu=cortex-m0 -show-encoding < %s | FileCheck %s
+@ RUN: not llvm-mc -triple=thumbv6-apple-darwin -show-encoding < %s > %t 2> %t2
+@ RUN: FileCheck %s --check-prefix=CHECK-EVIL-PRE-UAL < %t
+@ RUN: FileCheck %s --check-prefix CHECK-ERROR < %t2
+
+ .syntax unified
+
+ nop
+ yield
+ wfe
+ wfi
+ sev
+@ CHECK: nop @ encoding: [0x00,0xbf]
+@ CHECK: yield @ encoding: [0x10,0xbf]
+@ CHECK: wfe @ encoding: [0x20,0xbf]
+@ CHECK: wfi @ encoding: [0x30,0xbf]
+@ CHECK: sev @ encoding: [0x40,0xbf]
+
+
+@ CHECK-EVIL-PRE-UAL: mov r8, r8 @ encoding: [0xc0,0x46]
+
+
+@ CHECK-ERROR: error: instruction requires: armv6m or armv6t2
+@ CHECK-ERROR-NEXT: yield
+
+@ CHECK-ERROR: error: instruction requires: armv6m or armv6t2
+@ CHECK-ERROR-NEXT: wfe
+
+@ CHECK-ERROR: error: instruction requires: armv6m or armv6t2
+@ CHECK-ERROR-NEXT: wfi
+
+@ CHECK-ERROR: error: instruction requires: armv6m or armv6t2
+@ CHECK-ERROR-NEXT: sev
diff --git a/test/MC/ARM/thumb-nop.s b/test/MC/ARM/thumb-nop.s
deleted file mode 100644
index 66f61a6e0b..0000000000
--- a/test/MC/ARM/thumb-nop.s
+++ /dev/null
@@ -1,9 +0,0 @@
-@ RUN: llvm-mc -triple=thumbv6-apple-darwin -show-encoding < %s | FileCheck %s -check-prefix=CHECK-V6
-@ RUN: llvm-mc -triple=thumbv7-apple-darwin -show-encoding < %s | FileCheck %s -check-prefix=CHECK-V7
-
- .syntax unified
-
- nop
-
-@ CHECK-V6: mov r8, r8 @ encoding: [0xc0,0x46]
-@ CHECK-V7: nop @ encoding: [0x00,0xbf]