aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTim Northover <Tim.Northover@arm.com>2013-04-10 12:08:35 +0000
committerTim Northover <Tim.Northover@arm.com>2013-04-10 12:08:35 +0000
commit8c9e52a9fc1f99cf80c499ef10e6c8a54ef899d4 (patch)
treeb9506d93306a8ea590e51a69a8e489744f251a58 /test
parent2318508117fbc567bfef5b67a63c91ff7fad2697 (diff)
ARM: Make "SMC" instructions conditional on new TrustZone architecture feature.
These instructions aren't universally available, but depend on a specific extension to the normal ARM architecture (rather than, say, v6/v7/...) so a new feature is appropriate. This also enables the feature by default on A-class cores which usually have these extensions, to avoid breaking existing code and act as a sensible default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179171 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/ARM/arm-thumb-trustzone.s25
-rw-r--r--test/MC/ARM/arm-trustzone.s24
-rw-r--r--test/MC/ARM/basic-arm-instructions.s9
-rw-r--r--test/MC/Disassembler/ARM/arm-thumb-trustzone.txt17
-rw-r--r--test/MC/Disassembler/ARM/arm-trustzone.txt16
-rw-r--r--test/MC/Disassembler/ARM/basic-arm-instructions.txt9
6 files changed, 82 insertions, 18 deletions
diff --git a/test/MC/ARM/arm-thumb-trustzone.s b/test/MC/ARM/arm-thumb-trustzone.s
new file mode 100644
index 0000000000..a080b3efac
--- /dev/null
+++ b/test/MC/ARM/arm-thumb-trustzone.s
@@ -0,0 +1,25 @@
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=-trustzone < %s | FileCheck %s -check-prefix=NOTZ
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=trustzone < %s | FileCheck %s -check-prefix=TZ
+
+ .syntax unified
+ .globl _func
+
+@ Check that the assembler processes SMC instructions when TrustZone support is
+@ active and that it rejects them when this feature is not enabled
+
+_func:
+@ CHECK: _func
+
+
+@------------------------------------------------------------------------------
+@ SMC
+@------------------------------------------------------------------------------
+ smc #0xf
+ ite eq
+ smceq #0
+
+@ NOTZ-NOT: smc #15
+@ NOTZ-NOT: smceq #0
+@ TZ: smc #15 @ encoding: [0xff,0xf7,0x00,0x80]
+@ TZ: ite eq @ encoding: [0x0c,0xbf]
+@ TZ: smceq #0 @ encoding: [0xf0,0xf7,0x00,0x80]
diff --git a/test/MC/ARM/arm-trustzone.s b/test/MC/ARM/arm-trustzone.s
new file mode 100644
index 0000000000..69157f60dc
--- /dev/null
+++ b/test/MC/ARM/arm-trustzone.s
@@ -0,0 +1,24 @@
+@ RUN: llvm-mc -triple=armv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=-trustzone < %s | FileCheck %s -check-prefix=NOTZ
+@ RUN: llvm-mc -triple=armv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=trustzone < %s | FileCheck %s -check-prefix=TZ
+
+ .syntax unified
+ .globl _func
+
+@ Check that the assembler processes SMC instructions when TrustZone support is
+@ active and that it rejects them when this feature is not enabled
+
+_func:
+@ CHECK: _func
+
+
+@------------------------------------------------------------------------------
+@ SMC
+@------------------------------------------------------------------------------
+ smc #0xf
+ smceq #0
+
+@ NOTZ-NOT: smc #15
+@ NOTZ-NOT: smceq #0
+@ TZ: smc #15 @ encoding: [0x7f,0x00,0x60,0xe1]
+@ TZ: smceq #0 @ encoding: [0x70,0x00,0x60,0x01]
+
diff --git a/test/MC/ARM/basic-arm-instructions.s b/test/MC/ARM/basic-arm-instructions.s
index 560a0d633c..f73ae1449d 100644
--- a/test/MC/ARM/basic-arm-instructions.s
+++ b/test/MC/ARM/basic-arm-instructions.s
@@ -1791,15 +1791,6 @@ Lforward:
@ CHECK: shsub8gt r4, r8, r2 @ encoding: [0xf2,0x4f,0x38,0xc6]
@------------------------------------------------------------------------------
-@ SMC
-@------------------------------------------------------------------------------
- smc #0xf
- smceq #0
-
-@ CHECK: smc #15 @ encoding: [0x7f,0x00,0x60,0xe1]
-@ CHECK: smceq #0 @ encoding: [0x70,0x00,0x60,0x01]
-
-@------------------------------------------------------------------------------
@ SMLABB/SMLABT/SMLATB/SMLATT
@------------------------------------------------------------------------------
smlabb r3, r1, r9, r0
diff --git a/test/MC/Disassembler/ARM/arm-thumb-trustzone.txt b/test/MC/Disassembler/ARM/arm-thumb-trustzone.txt
new file mode 100644
index 0000000000..d6b7cf1a0b
--- /dev/null
+++ b/test/MC/Disassembler/ARM/arm-thumb-trustzone.txt
@@ -0,0 +1,17 @@
+# RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -disassemble -mattr=-trustzone < %s | FileCheck %s -check-prefix=NOTZ
+# RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -disassemble -mattr=trustzone < %s | FileCheck %s -check-prefix=TZ
+
+
+#------------------------------------------------------------------------------
+# SMC
+#------------------------------------------------------------------------------
+
+0xff 0xf7 0x00 0x80
+0x0c 0xbf
+0xf0 0xf7 0x00 0x80
+
+# NOTZ-NOT: smc #15
+# NOTZ-NOT: smceq #0
+# TZ: smc #15
+# TZ: ite eq
+# TZ: smceq #0
diff --git a/test/MC/Disassembler/ARM/arm-trustzone.txt b/test/MC/Disassembler/ARM/arm-trustzone.txt
new file mode 100644
index 0000000000..92d5d6b290
--- /dev/null
+++ b/test/MC/Disassembler/ARM/arm-trustzone.txt
@@ -0,0 +1,16 @@
+# RUN: llvm-mc -triple=armv7-apple-darwin -mcpu=cortex-a8 -disassemble -mattr=-trustzone < %s | FileCheck %s -check-prefix=NOTZ
+# RUN: llvm-mc -triple=armv7-apple-darwin -mcpu=cortex-a8 -disassemble -mattr=trustzone < %s | FileCheck %s -check-prefix=TZ
+
+
+#------------------------------------------------------------------------------
+# SMC
+#------------------------------------------------------------------------------
+
+0x7f 0x00 0x60 0xe1
+0x70 0x00 0x60 0x01
+
+# NOTZ-NOT: smc #15
+# NOTZ-NOT: smceq #0
+# TZ: smc #15
+# TZ: smceq #0
+
diff --git a/test/MC/Disassembler/ARM/basic-arm-instructions.txt b/test/MC/Disassembler/ARM/basic-arm-instructions.txt
index 1100ce64a9..477ba728b3 100644
--- a/test/MC/Disassembler/ARM/basic-arm-instructions.txt
+++ b/test/MC/Disassembler/ARM/basic-arm-instructions.txt
@@ -1442,15 +1442,6 @@
0xf2 0x4f 0x38 0xc6
#------------------------------------------------------------------------------
-# SMC
-#------------------------------------------------------------------------------
-# CHECK: smc #15
-# CHECK: smceq #0
-
-0x7f 0x00 0x60 0xe1
-0x70 0x00 0x60 0x01
-
-#------------------------------------------------------------------------------
# SMLABB/SMLABT/SMLATB/SMLATT
#------------------------------------------------------------------------------
# CHECK: smlabb r3, r1, r9, r0