summaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-10-08 08:06:34 +0000
committerNick Clifton <nickc@redhat.com>2013-10-08 08:06:34 +0000
commitb0e6a1b2249e4b329c0feeb903599f223d5d5c73 (patch)
treeb6a931c980dc6b42718bd2d845cb271f14869f08 /gas/testsuite
parentb337c58d283772fb8f45cf0ed25af493136acf85 (diff)
downloadbinutils-redhat-b0e6a1b2249e4b329c0feeb903599f223d5d5c73.tar.gz
* 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 e98e3d56bb..63f2c178f6 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 0000000000..9302cee135
--- /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 0000000000..218dcd0704
--- /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 0000000000..2af83b7ac0
--- /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 656ace8267..0b5a3aecfa 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 13fdb0beef..e080854497 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 db27597f86..d968faed98 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
+
+