aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorMatthew Wahab <matthew.wahab@arm.com>2015-11-19 14:13:45 +0000
committerMatthew Wahab <matthew.wahab@arm.com>2015-11-19 14:13:45 +0000
commitc2825638b6784179f191c6ee8ebbda1c49ae5271 (patch)
tree12ac512724b5ac2095d1a125a9fcd4f5b7c37897 /gas/testsuite
parent231c0592639d6f5c1796feb4a6375eab202a4acb (diff)
downloadgdb-c2825638b6784179f191c6ee8ebbda1c49ae5271.zip
gdb-c2825638b6784179f191c6ee8ebbda1c49ae5271.tar.gz
gdb-c2825638b6784179f191c6ee8ebbda1c49ae5271.tar.bz2
[AArch64] Reject invalid immediate operands to MSR PAN
The support for accessing the ARMv8.1 PSTATE field PAN allows instructions of the form MSR PAN, #<imm> with <imm> any unsigned 4-bit integer. However, the architecture specification requires that the immediate is either 0 or 1. This patch implements the constraint on the immediate, generating an error if the immediate operand is invalid, and adds tests for the illegal forms. opcodes/ 2015-11-19 Matthew Wahab <matthew.wahab@arm.com> * aarch64-opc.c (operand_general_constraint_met_p): Check validity of MSR PAN immediate operand. gas/testsuite/ 2015-11-19 Matthew Wahab <matthew.wahab@arm.com> * gas/aarch64/pan-illegal.d: New. * gas/aarch64/pan-illegal.l: New. * gas/aarch64/pan.s: Add tests for invalid immediates. Change-Id: Ibb3056c975eb792104da138d94594224f56a993e
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/aarch64/pan-illegal.d3
-rw-r--r--gas/testsuite/gas/aarch64/pan-illegal.l15
-rw-r--r--gas/testsuite/gas/aarch64/pan.s6
4 files changed, 30 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 51a622e..3d2b948 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-19 Matthew Wahab <matthew.wahab@arm.com>
+
+ * gas/aarch64/pan-illegal.d: New.
+ * gas/aarch64/pan-illegal.l: New.
+ * gas/aarch64/pan.s: Add tests for invalid immediates.
+
2015-11-19 Alan Modra <amodra@gmail.com>
* gas/ppc/altivec3.d: Allow for padding at end of section.
diff --git a/gas/testsuite/gas/aarch64/pan-illegal.d b/gas/testsuite/gas/aarch64/pan-illegal.d
new file mode 100644
index 0000000..372b9d7
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/pan-illegal.d
@@ -0,0 +1,3 @@
+#as: -march=armv8.1-a --defsym ERROR=1
+#source: pan.s
+#error-output: pan-illegal.l
diff --git a/gas/testsuite/gas/aarch64/pan-illegal.l b/gas/testsuite/gas/aarch64/pan-illegal.l
new file mode 100644
index 0000000..f620ab0
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/pan-illegal.l
@@ -0,0 +1,15 @@
+[^:]*: Assembler messages:
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#2'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#3'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#4'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#5'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#6'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#7'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#8'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#9'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#10'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#11'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#12'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#13'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#14'
+[^:]*:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr pan,#15'
diff --git a/gas/testsuite/gas/aarch64/pan.s b/gas/testsuite/gas/aarch64/pan.s
index 059046c..4144e2b 100644
--- a/gas/testsuite/gas/aarch64/pan.s
+++ b/gas/testsuite/gas/aarch64/pan.s
@@ -31,4 +31,10 @@
msr pan, x0
mrs x1, pan
+ .ifdef ERROR
+ .irp N,2,3,4,5,6,7,8,9,10,11,12,13,14,15
+ msr pan, #\N
+ .endr
+ .endif
+
.arch_extension nopan