aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorRenlin Li <renlin.li@arm.com>2016-10-19 11:18:56 +0100
committerRenlin Li <renlin.li@arm.com>2016-10-19 11:27:35 +0100
commit008a97eff0cabd416d18239eccd5267af6e965f3 (patch)
tree6406986f43b1b34a0cfa6720c572ee71784c9893 /gas/testsuite
parentbbb76b184f645ffc466baa1e5b3164d1e3febd93 (diff)
downloadgdb-008a97eff0cabd416d18239eccd5267af6e965f3.zip
gdb-008a97eff0cabd416d18239eccd5267af6e965f3.tar.gz
gdb-008a97eff0cabd416d18239eccd5267af6e965f3.tar.bz2
[GAS][ARM]Generate unpredictable warning for pc used in data processing instructions with register-shifted register operand.
gas/ 2016-10-19 Renlin Li <renlin.li@arm.com> * config/tc-arm.c (encode_arm_shift): Generate unpredictable warning for register-shifted register instructions. * testsuite/gas/arm/shift-bad-pc.d: New. * testsuite/gas/arm/shift-bad-pc.l: New. * testsuite/gas/arm/shift-bad-pc.s: New.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/arm/shift-bad-pc.d3
-rw-r--r--gas/testsuite/gas/arm/shift-bad-pc.l56
-rw-r--r--gas/testsuite/gas/arm/shift-bad-pc.s21
3 files changed, 80 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arm/shift-bad-pc.d b/gas/testsuite/gas/arm/shift-bad-pc.d
new file mode 100644
index 0000000..17edcd3
--- /dev/null
+++ b/gas/testsuite/gas/arm/shift-bad-pc.d
@@ -0,0 +1,3 @@
+# name: pc used in instructions with register-shifted register
+# as:
+# error-output: shift-bad-pc.l
diff --git a/gas/testsuite/gas/arm/shift-bad-pc.l b/gas/testsuite/gas/arm/shift-bad-pc.l
new file mode 100644
index 0000000..55a3295
--- /dev/null
+++ b/gas/testsuite/gas/arm/shift-bad-pc.l
@@ -0,0 +1,56 @@
+.*shift-bad-pc.s: Assembler messages:
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:20: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
+.*shift-bad-pc.s:21: Warning: using r15 results in unpredictable behaviour
diff --git a/gas/testsuite/gas/arm/shift-bad-pc.s b/gas/testsuite/gas/arm/shift-bad-pc.s
new file mode 100644
index 0000000..43fca39
--- /dev/null
+++ b/gas/testsuite/gas/arm/shift-bad-pc.s
@@ -0,0 +1,21 @@
+ .syntax unified
+
+ .macro insn4 rd rn rm rs
+ .irp insn, and, eor, sub, rsb, add, adc, sbc, rsc, orr, bic
+ \insn pc, \rn, \rm, lsr \rs
+ \insn \rd, pc, \rm, lsr \rs
+ \insn \rd, \rn, pc, lsr \rs
+ \insn \rd, \rn, \rm, lsr pc
+ .endr
+ .endm
+
+ .macro insn3 rn rm rs
+ .irp insn, tst, teq, cmp, cmn, mvn
+ \insn pc, \rm, lsr \rs
+ \insn \rn, pc, lsr \rs
+ \insn \rn, \rm, lsr pc
+ .endr
+ .endm
+
+ insn4 r0 r1 r2 r3
+ insn3 r0 r1 r2