aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorDenis Chertykov <chertykov@gmail.com>2014-03-29 09:53:16 +0400
committerDenis Chertykov <chertykov@gmail.com>2014-03-29 09:53:16 +0400
commitaf910977fbd500214e93d0a9b3d61e707df6d93c (patch)
tree139f96cbbb62fbbb04d6c655fd8c04410cbe3c55 /gas/testsuite
parented0251d24b7573e58fe22bea44c04887daedaa32 (diff)
downloadgdb-af910977fbd500214e93d0a9b3d61e707df6d93c.zip
gdb-af910977fbd500214e93d0a9b3d61e707df6d93c.tar.gz
gdb-af910977fbd500214e93d0a9b3d61e707df6d93c.tar.bz2
* config/tc-avr.c: Add specified_mcu variable for selected mcu.
(enum options): add OPTION_RMW_ISA for -mrmw option. (struct option md_longopts): Add mrmw option. (md_show_usage): add -mrmw option description. (md_parse_option): Update isa details if -mrmw option specified. * doc/c-avr.texi: Add doc for new option -mrmw. * gas/avr/avr.exp: Run new tests. * gas/avr/rmw.d: Add test for additional ISA support. * gas/avr/rmw.s: Ditto.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/avr/avr.exp24
-rw-r--r--gas/testsuite/gas/avr/rmw.d23
-rw-r--r--gas/testsuite/gas/avr/rmw.s32
3 files changed, 79 insertions, 0 deletions
diff --git a/gas/testsuite/gas/avr/avr.exp b/gas/testsuite/gas/avr/avr.exp
new file mode 100644
index 0000000..fc90f9f
--- /dev/null
+++ b/gas/testsuite/gas/avr/avr.exp
@@ -0,0 +1,24 @@
+# Copyright 2014
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+#
+# Some AVR tests
+#
+
+if {[istarget avr-*-*]} {
+ run_dump_tests [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+}
diff --git a/gas/testsuite/gas/avr/rmw.d b/gas/testsuite/gas/avr/rmw.d
new file mode 100644
index 0000000..48554e1
--- /dev/null
+++ b/gas/testsuite/gas/avr/rmw.d
@@ -0,0 +1,23 @@
+#name: AVR RMW instructions
+#as: -mmcu=avrxmega2 -mrmw
+#objdump: -dr --show-raw-insn
+#target: avr-*-*
+
+.*: +file format elf32-avr
+
+Disassembly of section .text:
+
+00000000 <main>:
+ 0: cf 93 push r28
+ 2: df 93 push r29
+ 4: cd b7 in r28, 0x3d ; 61
+ 6: de b7 in r29, 0x3e ; 62
+ 8: c4 92 xch Z, r12
+ a: c5 92 las Z, r12
+ c: c6 92 lac Z, r12
+ e: c7 92 lat Z, r12
+ 10: 80 e0 ldi r24, 0x00 ; 0
+ 12: 90 e0 ldi r25, 0x00 ; 0
+ 14: df 91 pop r29
+ 16: cf 91 pop r28
+ 18: 08 95 ret
diff --git a/gas/testsuite/gas/avr/rmw.s b/gas/testsuite/gas/avr/rmw.s
new file mode 100644
index 0000000..fca39c9
--- /dev/null
+++ b/gas/testsuite/gas/avr/rmw.s
@@ -0,0 +1,32 @@
+ .file "rmw.s"
+__SP_H__ = 0x3e
+__SP_L__ = 0x3d
+__SREG__ = 0x3f
+__CCP__ = 0x34
+__tmp_reg__ = 0
+__zero_reg__ = 1
+ .text
+.global main
+ .type main, @function
+main:
+ push r28
+ push r29
+ in r28,__SP_L__
+ in r29,__SP_H__
+/* prologue: function */
+/* frame size = 0 */
+/* stack size = 2 */
+.L__stack_usage = 2
+/* #APP */
+ xch Z, r12
+ las Z, r12
+ lac Z, r12
+ lat Z, r12
+/* #NOAPP */
+ ldi r24,0
+ ldi r25,0
+/* epilogue start */
+ pop r29
+ pop r28
+ ret
+ .size main, .-main