diff options
author | Vinay Kumar <vinay.g@kpit.com> | 2015-10-27 14:00:40 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2015-10-27 14:00:40 +0000 |
commit | 02f12cd4669463a1b2346145808213adeb303e2d (patch) | |
tree | 173fc4a7a578830e6145027aeb31191d7229febb /gas | |
parent | c6486df5f1400d90a13df5c6dbd96aeaccf8225b (diff) | |
download | gdb-02f12cd4669463a1b2346145808213adeb303e2d.zip gdb-02f12cd4669463a1b2346145808213adeb303e2d.tar.gz gdb-02f12cd4669463a1b2346145808213adeb303e2d.tar.bz2 |
Fix RL78 disassembly so that SP+OFFSET addressing always shows the offset, even when zero.
PR binutils/19157
opcodes * rl78-decode.opc: Add 'a' print operator to mov instructions
using stack pointer plus index addressing.
* rl78-decode.c: Regenerate.
tests * gas/rl78: New directory.
* gas/rl78/rl78.exp: New test driver.
* gas/rl78/pr19157.s: New test source file.
* gas/rl78/pr19157.d: New test case.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/rl78/pr19157.d | 15 | ||||
-rw-r--r-- | gas/testsuite/gas/rl78/pr19157.s | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/rl78/rl78.exp | 23 |
4 files changed, 59 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 89d282f..df44690 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-10-27 Nick Clifton <nickc@redhat.com> + + PR binutils/19157 + * gas/rl78: New directory. + * gas/rl78/rl78.exp: New test driver. + * gas/rl78/pr19157.s: New test source file. + * gas/rl78/pr19157.d: New test case. + 2015-10-22 Nick Clifton <nickc@redhat.com> * gas/msp430/errata_fixes.s: New test source file. diff --git a/gas/testsuite/gas/rl78/pr19157.d b/gas/testsuite/gas/rl78/pr19157.d new file mode 100644 index 0000000..9bbbc10 --- /dev/null +++ b/gas/testsuite/gas/rl78/pr19157.d @@ -0,0 +1,15 @@ +#objdump: -d --prefix-addresses --show-raw-insn +#name: PR19157: RL78: zero offset omitted + +.*: +file format .*rl78.* + +Disassembly of section .text: +0x0+000 88 00[ ]+mov[ ]+a, \[sp\+0\] +0x0+002 88 00[ ]+mov[ ]+a, \[sp\+0\] +0x0+004 88 01[ ]+mov[ ]+a, \[sp\+1\] +0x0+006 a8 00[ ]+movw[ ]+ax, \[sp\+0\] +0x0+008 a8 00[ ]+movw[ ]+ax, \[sp\+0\] +0x0+00a a8 02[ ]+movw[ ]+ax, \[sp\+2\] +0x0+00c c8 00 09[ ]+mov[ ]+\[sp\+0\], #9 +0x0+00f c8 00 09[ ]+mov[ ]+\[sp\+0\], #9 +0x0+012 c8 01 09[ ]+mov[ ]+\[sp\+1\], #9 diff --git a/gas/testsuite/gas/rl78/pr19157.s b/gas/testsuite/gas/rl78/pr19157.s new file mode 100644 index 0000000..2da33b7 --- /dev/null +++ b/gas/testsuite/gas/rl78/pr19157.s @@ -0,0 +1,13 @@ + .text + + mov a, [sp] + mov a, [sp + 0] + mov a, [sp + 1] + movw ax, [sp] + movw ax, [sp + 0] + movw ax, [sp + 2] + mov [sp], # 9 + mov [sp + 0], # 9 + mov [sp + 1], # 9 + + .end diff --git a/gas/testsuite/gas/rl78/rl78.exp b/gas/testsuite/gas/rl78/rl78.exp new file mode 100644 index 0000000..9341981 --- /dev/null +++ b/gas/testsuite/gas/rl78/rl78.exp @@ -0,0 +1,23 @@ +# Copyright (C) 2015 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. + +# +# RL78 tests +# + +if [expr [istarget "rl78-*-*"]] then { + run_dump_test "pr19157" +} |