aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2005-03-15 20:38:00 +0000
committerZack Weinberg <zackw@panix.com>2005-03-15 20:38:00 +0000
commitb05fe5cf682fff1677b2f8a9bf4328cdeb401e5b (patch)
tree84f32269b26f9dee9b455b922d2c4649abd44387 /gas/testsuite
parent957d91c17826944963506e9479ac670b09d35a24 (diff)
downloadgdb-b05fe5cf682fff1677b2f8a9bf4328cdeb401e5b.zip
gdb-b05fe5cf682fff1677b2f8a9bf4328cdeb401e5b.tar.gz
gdb-b05fe5cf682fff1677b2f8a9bf4328cdeb401e5b.tar.bz2
* config/tc-arm.c (do_mla): Rename to do_mlas, take second
is_mls parameter; do not diagnose Rm==Rd when is_mls. (do_mla, do_mls, five_bit_unsigned_immediate, bfci_lsb_and_width) (do_bfc, do_bfi, do_bfx, do_rbit, do_mov16, do_ldsttv4): New functions. (insns): Add ARMv6T2 instructions: bfc bfi mls movw movt rbit sbfx ubfx ldrht ldrsht ldrsbt strht. (arm_archs): Add V6T2 variants. testsuite: * gas/arm/archv6t2.d, gas/arm/archv6t2.s: New dump test. * gas/arm/archv6t2-bad.l, gas/arm/archv6t2-bad.l: New errors test. * gas/arm/arm.exp: Run them.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/arm/archv6t2-bad.l38
-rw-r--r--gas/testsuite/gas/arm/archv6t2-bad.s53
-rw-r--r--gas/testsuite/gas/arm/archv6t2.d51
-rw-r--r--gas/testsuite/gas/arm/archv6t2.s55
-rw-r--r--gas/testsuite/gas/arm/arm.exp2
6 files changed, 205 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 4ea866d..86af7eb 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-15 Zack Weinberg <zack@codesourcery.com>
+
+ * gas/arm/archv6t2.d, gas/arm/archv6t2.s: New dump test.
+ * gas/arm/archv6t2-bad.l, gas/arm/archv6t2-bad.l: New errors test.
+ * gas/arm/arm.exp: Run them.
+
2005-03-14 Eric Christopher <echristo@redhat.com>
* gas/cfi/cfi-mips-1.d, gas/cfi/cfi-mips-1.s: New dump test.
diff --git a/gas/testsuite/gas/arm/archv6t2-bad.l b/gas/testsuite/gas/arm/archv6t2-bad.l
new file mode 100644
index 0000000..e8da4b8
--- /dev/null
+++ b/gas/testsuite/gas/arm/archv6t2-bad.l
@@ -0,0 +1,38 @@
+[^:]*: Assembler messages:
+[^:]*:6: Error: r15 not allowed here -- `bfc pc,#0,#1'
+[^:]*:7: Error: r15 not allowed here -- `bfi pc,r0,#0,#1'
+[^:]*:8: Error: r15 not allowed here -- `movw pc,#0'
+[^:]*:9: Error: r15 not allowed here -- `movt pc,#0'
+[^:]*:12: Error: immediate value out of range -- `bfc r0,#0,#0'
+[^:]*:13: Error: immediate value out of range -- `bfc r0,#32,#0'
+[^:]*:14: Error: immediate value out of range -- `bfc r0,#0,#33'
+[^:]*:15: Error: immediate value out of range -- `bfc r0,#33,#1'
+[^:]*:16: Error: immediate value out of range -- `bfc r0,#32,#1'
+[^:]*:17: Error: bit-field extends past end of register -- `bfc r0,#28,#10'
+[^:]*:19: Error: immediate value out of range -- `bfi r0,r1,#0,#0'
+[^:]*:20: Error: immediate value out of range -- `bfi r0,r1,#32,#0'
+[^:]*:21: Error: immediate value out of range -- `bfi r0,r1,#0,#33'
+[^:]*:22: Error: immediate value out of range -- `bfi r0,r1,#33,#1'
+[^:]*:23: Error: immediate value out of range -- `bfi r0,r1,#32,#1'
+[^:]*:24: Error: bit-field extends past end of register -- `bfi r0,r1,#28,#10'
+[^:]*:26: Error: immediate value out of range -- `sbfx r0,r1,#0,#0'
+[^:]*:27: Error: immediate value out of range -- `sbfx r0,r1,#32,#0'
+[^:]*:28: Error: immediate value out of range -- `sbfx r0,r1,#0,#33'
+[^:]*:29: Error: immediate value out of range -- `sbfx r0,r1,#33,#1'
+[^:]*:30: Error: immediate value out of range -- `sbfx r0,r1,#32,#1'
+[^:]*:31: Error: bit-field extends past end of register -- `sbfx r0,r1,#28,#10'
+[^:]*:33: Error: immediate value out of range -- `ubfx r0,r1,#0,#0'
+[^:]*:34: Error: immediate value out of range -- `ubfx r0,r1,#32,#0'
+[^:]*:35: Error: immediate value out of range -- `ubfx r0,r1,#0,#33'
+[^:]*:36: Error: immediate value out of range -- `ubfx r0,r1,#33,#1'
+[^:]*:37: Error: immediate value out of range -- `ubfx r0,r1,#32,#1'
+[^:]*:38: Error: bit-field extends past end of register -- `ubfx r0,r1,#28,#10'
+[^:]*:41: Error: immediate value out of range -- `bfi r0,#1,#2,#3'
+[^:]*:44: Error: immediate value out of range -- `movt r0,#65537'
+[^:]*:45: Error: immediate value out of range -- `movw r0,#65537'
+[^:]*:46: Error: immediate value out of range -- `movt r0,#-1'
+[^:]*:47: Error: immediate value out of range -- `movw r0,#-1'
+[^:]*:50: Warning: destination register same as write-back base
+[^:]*:51: Warning: destination register same as write-back base
+[^:]*:52: Warning: destination register same as write-back base
+[^:]*:53: Warning: source register same as write-back base
diff --git a/gas/testsuite/gas/arm/archv6t2-bad.s b/gas/testsuite/gas/arm/archv6t2-bad.s
new file mode 100644
index 0000000..e568869
--- /dev/null
+++ b/gas/testsuite/gas/arm/archv6t2-bad.s
@@ -0,0 +1,53 @@
+ @ We do not bother testing simple cases, e.g. immediates where
+ @ registers belong, trailing junk at end of line.
+ .text
+x:
+ @ pc not allowed
+ bfc pc,#0,#1
+ bfi pc,r0,#0,#1
+ movw pc,#0
+ movt pc,#0
+
+ @ bitfield range limits
+ bfc r0,#0,#0
+ bfc r0,#32,#0
+ bfc r0,#0,#33
+ bfc r0,#33,#1
+ bfc r0,#32,#1
+ bfc r0,#28,#10
+
+ bfi r0,r1,#0,#0
+ bfi r0,r1,#32,#0
+ bfi r0,r1,#0,#33
+ bfi r0,r1,#33,#1
+ bfi r0,r1,#32,#1
+ bfi r0,r1,#28,#10
+
+ sbfx r0,r1,#0,#0
+ sbfx r0,r1,#32,#0
+ sbfx r0,r1,#0,#33
+ sbfx r0,r1,#33,#1
+ sbfx r0,r1,#32,#1
+ sbfx r0,r1,#28,#10
+
+ ubfx r0,r1,#0,#0
+ ubfx r0,r1,#32,#0
+ ubfx r0,r1,#0,#33
+ ubfx r0,r1,#33,#1
+ ubfx r0,r1,#32,#1
+ ubfx r0,r1,#28,#10
+
+ @ bfi accepts only #0 in Rm position
+ bfi r0,#1,#2,#3
+
+ @ mov16 range limits
+ movt r0,#65537
+ movw r0,#65537
+ movt r0,#-1
+ movw r0,#-1
+
+ @ ldsttv4 Rd == Rn (warning)
+ ldrht r0,[r0]
+ ldrsbt r0,[r0]
+ ldrsht r0,[r0]
+ strht r0,[r0]
diff --git a/gas/testsuite/gas/arm/archv6t2.d b/gas/testsuite/gas/arm/archv6t2.d
new file mode 100644
index 0000000..8e8b038
--- /dev/null
+++ b/gas/testsuite/gas/arm/archv6t2.d
@@ -0,0 +1,51 @@
+#name: ARM V6T2 instructions
+#as: -march=armv6t2
+#objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+00 <[^>]+> e7c00010 bfi r0, r0, #0, #1
+0+04 <[^>]+> 17c00010 bfine r0, r0, #0, #1
+0+08 <[^>]+> e7c09010 bfi r9, r0, #0, #1
+0+0c <[^>]+> e7c00019 bfi r0, r9, #0, #1
+0+10 <[^>]+> e7d10010 bfi r0, r0, #0, #18
+0+14 <[^>]+> e7d10890 bfi r0, r0, #17, #1
+0+18 <[^>]+> e7c0001f bfc r0, #0, #1
+0+1c <[^>]+> e7c0001f bfc r0, #0, #1
+0+20 <[^>]+> 17c0001f bfcne r0, #0, #1
+0+24 <[^>]+> e7c0901f bfc r9, #0, #1
+0+28 <[^>]+> e7d1001f bfc r0, #0, #18
+0+2c <[^>]+> e7d1089f bfc r0, #17, #1
+0+30 <[^>]+> e7a00050 sbfx r0, r0, #0, #1
+0+34 <[^>]+> 17a00050 sbfxne r0, r0, #0, #1
+0+38 <[^>]+> e7e00050 ubfx r0, r0, #0, #1
+0+3c <[^>]+> e7a09050 sbfx r9, r0, #0, #1
+0+40 <[^>]+> e7a00059 sbfx r0, r9, #0, #1
+0+44 <[^>]+> e7a008d0 sbfx r0, r0, #17, #1
+0+48 <[^>]+> e7b10050 sbfx r0, r0, #0, #18
+0+4c <[^>]+> e3ff0f30 rbit r0, r0
+0+50 <[^>]+> 13ff0f30 rbitne r0, r0
+0+54 <[^>]+> e3ff9f30 rbit r9, r0
+0+58 <[^>]+> e3ff0f39 rbit r0, r9
+0+5c <[^>]+> e0600090 mls r0, r0, r0, r0
+0+60 <[^>]+> 10600090 mlsne r0, r0, r0, r0
+0+64 <[^>]+> e0690090 mls r9, r0, r0, r0
+0+68 <[^>]+> e0600099 mls r0, r9, r0, r0
+0+6c <[^>]+> e0600990 mls r0, r0, r9, r0
+0+70 <[^>]+> e0609090 mls r0, r0, r0, r9
+0+74 <[^>]+> e3000000 movw r0, #0 ; 0x0
+0+78 <[^>]+> e3400000 movt r0, #0 ; 0x0
+0+7c <[^>]+> 13000000 movwne r0, #0 ; 0x0
+0+80 <[^>]+> e3009000 movw r9, #0 ; 0x0
+0+84 <[^>]+> e3000999 movw r0, #2457 ; 0x999
+0+88 <[^>]+> e3090000 movw r0, #36864 ; 0x9000
+0+8c <[^>]+> e0f900b0 ldrht r0, \[r9\]
+0+90 <[^>]+> e0f900f0 ldrsht r0, \[r9\]
+0+94 <[^>]+> e0f900d0 ldrsbt r0, \[r9\]
+0+98 <[^>]+> e0e900b0 strht r0, \[r9\]
+0+9c <[^>]+> 10f900b0 ldrneht r0, \[r9\]
+0+a0 <[^>]+> e0b090b9 ldrht r9, \[r0\], r9
+0+a4 <[^>]+> e03090b9 ldrht r9, \[r0\], -r9
+0+a8 <[^>]+> e0f099b9 ldrht r9, \[r0\], #153
+0+ac <[^>]+> e07099b9 ldrht r9, \[r0\], #-153
diff --git a/gas/testsuite/gas/arm/archv6t2.s b/gas/testsuite/gas/arm/archv6t2.s
new file mode 100644
index 0000000..292f11c
--- /dev/null
+++ b/gas/testsuite/gas/arm/archv6t2.s
@@ -0,0 +1,55 @@
+ .text
+x:
+ bfi r0, r0, #0, #1
+ bfine r0, r0, #0, #1
+
+ bfi r9, r0, #0, #1
+ bfi r0, r9, #0, #1
+ bfi r0, r0, #0, #18
+ bfi r0, r0, #17, #1
+
+ bfi r0, #0, #0, #1
+ bfc r0, #0, #1
+ bfcne r0, #0, #1
+ bfc r9, #0, #1
+ bfc r0, #0, #18
+ bfc r0, #17, #1
+
+ sbfx r0, r0, #0, #1
+ sbfxne r0, r0, #0, #1
+ ubfx r0, r0, #0, #1
+ sbfx r9, r0, #0, #1
+ sbfx r0, r9, #0, #1
+ sbfx r0, r0, #17, #1
+ sbfx r0, r0, #0, #18
+
+ rbit r0, r0
+ rbitne r0, r0
+ rbit r9, r0
+ rbit r0, r9
+
+ mls r0, r0, r0, r0
+ mlsne r0, r0, r0, r0
+ mls r9, r0, r0, r0
+ mls r0, r9, r0, r0
+ mls r0, r0, r9, r0
+ mls r0, r0, r0, r9
+
+ movw r0, #0
+ movt r0, #0
+ movwne r0, #0
+ movw r9, #0
+ movw r0, #0x0999
+ movw r0, #0x9000
+
+ @ for these, we must avoid write-back warnings
+ ldrht r0, [r9]
+ ldrsht r0, [r9]
+ ldrsbt r0, [r9]
+ strht r0, [r9]
+ ldrneht r0, [r9]
+
+ ldrht r9, [r0], r9
+ ldrht r9, [r0], -r9
+ ldrht r9, [r0], #0x99
+ ldrht r9, [r0], #-0x99
diff --git a/gas/testsuite/gas/arm/arm.exp b/gas/testsuite/gas/arm/arm.exp
index a84c80b..4ea6454 100644
--- a/gas/testsuite/gas/arm/arm.exp
+++ b/gas/testsuite/gas/arm/arm.exp
@@ -49,6 +49,7 @@ if {[istarget *arm*-*-*] || [istarget "xscale-*-*"]} then {
run_dump_test "reg-alias"
run_dump_test "maverick"
run_dump_test "archv6"
+ run_dump_test "archv6t2"
run_dump_test "thumbv6"
run_dump_test "thumbv6k"
run_dump_test "arch6zk"
@@ -57,6 +58,7 @@ if {[istarget *arm*-*-*] || [istarget "xscale-*-*"]} then {
run_errors_test "req" "-mcpu=arm7m" ".req errors"
run_errors_test "armv1-bad" "-mcpu=arm7m" "ARM v1 errors"
run_errors_test "r15-bad" "" "Invalid use of r15 errors"
+ run_errors_test "archv6t2-bad" "-march=armv6t2" "Invalid V6T2 instructions"
if {[istarget *-*-*coff] || [istarget *-*-pe] || [istarget *-*-wince] ||
[istarget *-*-*aout*] || [istarget *-*-netbsd] || [istarget *-*-riscix*]} then {