aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-10-08 08:06:35 +0000
committerNick Clifton <nickc@redhat.com>2013-10-08 08:06:35 +0000
commit38d7754573539a6c124fb9c28bd24cc9849312b7 (patch)
treeb420d8a20e0932adfa61fca5c05e12921f1d35d3 /gas/testsuite
parentf424ae209c603253aeabcbaf442e4bb5a042816f (diff)
downloadgdb-38d7754573539a6c124fb9c28bd24cc9849312b7.zip
gdb-38d7754573539a6c124fb9c28bd24cc9849312b7.tar.gz
gdb-38d7754573539a6c124fb9c28bd24cc9849312b7.tar.bz2
* config/tc-msp430.c (msp430_operands): Accept "<foo>.a" as an alias
for "<foo>a". Issue error messages for unrecognised or corrrupt size extensions. * gas/msp430/bad.s: New test: Checks erroneous size extensions. * gas/msp430/bad.d: New test command file. * gas/msp430/bad.l: New file: Expected error messages. * gas/msp430/msp430.exp: Run the new test. * gas/msp430/msp430x.s: Add "<foo>.a" aliases of "<foo>a" instructions. * gas/msp430/msp430x.d: Update expected disassembly.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog10
-rw-r--r--gas/testsuite/gas/msp430/bad.d3
-rw-r--r--gas/testsuite/gas/msp430/bad.l7
-rw-r--r--gas/testsuite/gas/msp430/bad.s13
-rw-r--r--gas/testsuite/gas/msp430/msp430.exp1
-rw-r--r--gas/testsuite/gas/msp430/msp430x.d11
-rw-r--r--gas/testsuite/gas/msp430/msp430x.s16
7 files changed, 61 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index e98e3d5..63f2c17 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2013-10-08 Nick Clifton <nickc@redhat.com>
+
+ * gas/msp430/bad.s: New test: Checks erroneous size extensions.
+ * gas/msp430/bad.d: New test command file.
+ * gas/msp430/bad.l: New file: Expected error messages.
+ * gas/msp430/msp430.exp: Run the new test.
+ * gas/msp430/msp430x.s: Add "<foo>.a" aliases of "<foo>a"
+ instructions.
+ * gas/msp430/msp430x.d: Update expected disassembly.
+
2013-10-07 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* gas/mips/micromips@virt64.d: Fix dmfgc0 and dmtgc0.
diff --git a/gas/testsuite/gas/msp430/bad.d b/gas/testsuite/gas/msp430/bad.d
new file mode 100644
index 0000000..9302cee
--- /dev/null
+++ b/gas/testsuite/gas/msp430/bad.d
@@ -0,0 +1,3 @@
+#name: Diagnostics Quality
+#source: bad.s
+#error-output: bad.l
diff --git a/gas/testsuite/gas/msp430/bad.l b/gas/testsuite/gas/msp430/bad.l
new file mode 100644
index 0000000..218dcd0
--- /dev/null
+++ b/gas/testsuite/gas/msp430/bad.l
@@ -0,0 +1,7 @@
+[^:]*: Assembler messages:
+[^:]*:6: Error: unrecognised instruction size modifier .z
+[^:]*:7: Error: junk found after instruction: mov.bc r1,r2
+[^:]*:8: Error: junk found after instruction: mov.cd r1,r2
+[^:]*:9: Error: junk found after instruction: mov.cd r1,r2
+[^:]*:10: Warning: no size modifier after period, .w assumed
+[^:]*:11: Error: instruction bis.a does not exist
diff --git a/gas/testsuite/gas/msp430/bad.s b/gas/testsuite/gas/msp430/bad.s
new file mode 100644
index 0000000..2af83b7
--- /dev/null
+++ b/gas/testsuite/gas/msp430/bad.s
@@ -0,0 +1,13 @@
+ .text
+ .cpu 430x
+
+;;; Test for the assembler detecting spurious size modifiers.
+
+ mov.z r1, r2
+ mov.abc r1, r2
+ mov.bcd r1, r2
+ mov.wcd r1, r2
+ mov. r1, r2
+ bis.a #8, r2
+
+;;; FIXME: Add more tests of assembler error detection here.
diff --git a/gas/testsuite/gas/msp430/msp430.exp b/gas/testsuite/gas/msp430/msp430.exp
index 656ace8..0b5a3ae 100644
--- a/gas/testsuite/gas/msp430/msp430.exp
+++ b/gas/testsuite/gas/msp430/msp430.exp
@@ -21,4 +21,5 @@
if [expr [istarget "msp430-*-*"]] then {
run_dump_test "opcode"
run_dump_test "msp430x"
+ run_dump_test "bad"
}
diff --git a/gas/testsuite/gas/msp430/msp430x.d b/gas/testsuite/gas/msp430/msp430x.d
index 13fdb0b..e080854 100644
--- a/gas/testsuite/gas/msp430/msp430x.d
+++ b/gas/testsuite/gas/msp430/msp430x.d
@@ -214,3 +214,14 @@ Disassembly of section .text:
0+03c8 <[^>]*> 40 18 82 11 sxtx.w r2 ;
0+03cc <[^>]*> 04 18 45 11 rpt #5 \{ rrax.a r5 ;
0+03d0 <[^>]*> 85 18 45 11 rpt r5 \{ rrax.a r5 ;
+0+03d4 <[^>]*> e2 01 adda r1, r2 ;
+0+03d6 <[^>]*> c0 01 mova r1, r0 ;
+0+03d8 <[^>]*> 41 13 calla r1 ;
+0+03da <[^>]*> 40 18 01 43 clrx.w r1 ;
+0+03de <[^>]*> d2 01 cmpa r1, r2 ;
+0+03e0 <[^>]*> 40 18 21 83 decdx.w r1 ;
+0+03e4 <[^>]*> 40 18 21 53 incdx.w r1 ;
+0+03e8 <[^>]*> c2 01 mova r1, r2 ;
+0+03ea <[^>]*> 10 01 reta ;
+0+03ec <[^>]*> f2 01 suba r1, r2 ;
+0+03ee <[^>]*> 40 18 80 93 00 00 cmpx.w #0, 0x0000 ;r3 As==00, PC rel. 0x03f2
diff --git a/gas/testsuite/gas/msp430/msp430x.s b/gas/testsuite/gas/msp430/msp430x.s
index db27597..d968fae 100644
--- a/gas/testsuite/gas/msp430/msp430x.s
+++ b/gas/testsuite/gas/msp430/msp430x.s
@@ -259,3 +259,19 @@ foo:
rrax.a r5
rpt r5
rrax.a r5
+
+ ;; The following are all aliases for similarly named instructions
+ ;; without the period. Eg: add.a -> adda
+ add.a r1, r2
+ br.a r1
+ call.a r1
+ clr.a r1
+ cmp.a r1, r2
+ decd.a r1
+ incd.a r1
+ mov.a r1, r2
+ ret.a
+ sub.a r1, r2
+ tst.a fooz
+
+