aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-06-30 13:42:46 +0000
committerNick Clifton <nickc@redhat.com>2011-06-30 13:42:46 +0000
commit5f4cb1986d38875f7541b53e41ae7fb1e7460f14 (patch)
treee8a4257e783817c6b4ee9578b7b3d04a3bfdcf9d /gas/testsuite
parent68246214dfc90b41caecb381289368dbecfcafbe (diff)
downloadgdb-5f4cb1986d38875f7541b53e41ae7fb1e7460f14.zip
gdb-5f4cb1986d38875f7541b53e41ae7fb1e7460f14.tar.gz
gdb-5f4cb1986d38875f7541b53e41ae7fb1e7460f14.tar.bz2
* gas/arm/addthumb2err.s: New test file.
* gas/arm/addthumb2err.d: Test control file. * gas/arm/addthumb2err.l: Expected error messages. * config/tc-arm.c (do_t_add_sub): Only allow LSL shifts of less than 4 in Thumb mode.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/arm/addthumb2err.d7
-rw-r--r--gas/testsuite/gas/arm/addthumb2err.l21
-rw-r--r--gas/testsuite/gas/arm/addthumb2err.s28
4 files changed, 62 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 3999422..c5408b8 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-30 Paul Carroll <pcarroll@codesourcery.com>
+
+ * gas/arm/addthumb2err.s: New test file.
+ * gas/arm/addthumb2err.d: Test control file.
+ * gas/arm/addthumb2err.l: Expected error messages.
+
2011-06-30 Nick Clifton <nickc@redhat.com>
PR gas/12931
diff --git a/gas/testsuite/gas/arm/addthumb2err.d b/gas/testsuite/gas/arm/addthumb2err.d
new file mode 100644
index 0000000..46532f3
--- /dev/null
+++ b/gas/testsuite/gas/arm/addthumb2err.d
@@ -0,0 +1,7 @@
+#name: bad Thumb2 Add{S} and Sub{S} instructions
+#as: -march=armv7-a
+#error-output: addthumb2err.l
+
+# Test some Thumb2 instructions:
+
+.*: +file format .*arm.*
diff --git a/gas/testsuite/gas/arm/addthumb2err.l b/gas/testsuite/gas/arm/addthumb2err.l
new file mode 100644
index 0000000..c77d551
--- /dev/null
+++ b/gas/testsuite/gas/arm/addthumb2err.l
@@ -0,0 +1,21 @@
+[^:]*: Assembler messages:
+[^:]*:9: Error: shift value over 3 not allowed in thumb mode -- `add sp,sp,r0,LSL#4'
+[^:]*:10: Error: only LSL shift allowed in thumb mode -- `add sp,sp,r0,LSR#3'
+[^:]*:11: Error: only LSL shift allowed in thumb mode -- `add sp,sp,r0,ASR#3'
+[^:]*:12: Error: only LSL shift allowed in thumb mode -- `add sp,sp,r0,ROR#3'
+[^:]*:13: Error: only LSL shift allowed in thumb mode -- `add sp,sp,r0,RRX'
+[^:]*:14: Error: shift value over 3 not allowed in thumb mode -- `adds sp,sp,r0,LSL#4'
+[^:]*:15: Error: only LSL shift allowed in thumb mode -- `adds sp,sp,r0,LSR#3'
+[^:]*:16: Error: only LSL shift allowed in thumb mode -- `adds sp,sp,r0,ASR#3'
+[^:]*:17: Error: only LSL shift allowed in thumb mode -- `adds sp,sp,r0,ROR#3'
+[^:]*:18: Error: only LSL shift allowed in thumb mode -- `adds sp,sp,r0,RRX'
+[^:]*:19: Error: shift value over 3 not allowed in thumb mode -- `sub sp,sp,r0,LSL#4'
+[^:]*:20: Error: only LSL shift allowed in thumb mode -- `sub sp,sp,r0,LSR#3'
+[^:]*:21: Error: only LSL shift allowed in thumb mode -- `sub sp,sp,r0,ASR#3'
+[^:]*:22: Error: only LSL shift allowed in thumb mode -- `sub sp,sp,r0,ROR#3'
+[^:]*:23: Error: only LSL shift allowed in thumb mode -- `sub sp,sp,r0,RRX'
+[^:]*:24: Error: shift value over 3 not allowed in thumb mode -- `subs sp,sp,r0,LSL#4'
+[^:]*:25: Error: only LSL shift allowed in thumb mode -- `subs sp,sp,r0,LSR#3'
+[^:]*:26: Error: only LSL shift allowed in thumb mode -- `subs sp,sp,r0,ASR#3'
+[^:]*:27: Error: only LSL shift allowed in thumb mode -- `subs sp,sp,r0,ROR#3'
+[^:]*:28: Error: only LSL shift allowed in thumb mode -- `subs sp,sp,r0,RRX'
diff --git a/gas/testsuite/gas/arm/addthumb2err.s b/gas/testsuite/gas/arm/addthumb2err.s
new file mode 100644
index 0000000..139c195
--- /dev/null
+++ b/gas/testsuite/gas/arm/addthumb2err.s
@@ -0,0 +1,28 @@
+ .syntax unified
+ .text
+ .align 2
+ .thumb
+
+ # Test of invalid operands for ADD{S} and SUB{S} instructions
+ # in Thumb2 mode. The instruction form being testing
+ # involves having the first 2 operands be SP.
+ add sp, sp, r0, LSL #4
+ add sp, sp, r0, LSR #3
+ add sp, sp, r0, ASR #3
+ add sp, sp, r0, ROR #3
+ add sp, sp, r0, RRX
+ adds sp, sp, r0, LSL #4
+ adds sp, sp, r0, LSR #3
+ adds sp, sp, r0, ASR #3
+ adds sp, sp, r0, ROR #3
+ adds sp, sp, r0, RRX
+ sub sp, sp, r0, LSL #4
+ sub sp, sp, r0, LSR #3
+ sub sp, sp, r0, ASR #3
+ sub sp, sp, r0, ROR #3
+ sub sp, sp, r0, RRX
+ subs sp, sp, r0, LSL #4
+ subs sp, sp, r0, LSR #3
+ subs sp, sp, r0, ASR #3
+ subs sp, sp, r0, ROR #3
+ subs sp, sp, r0, RRX