1 # Copyright (C) 2004-2016 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17 if {![istarget "arm*-*-*"]} then {
21 if {[istarget "*-*-aout"]} then {
25 if {![is_remote host] && [which $OBJDUMP] == 0} then {
26 perror "$OBJDUMP does not exist"
30 send_user "Version [binutil_version $OBJDUMP]"
32 ###########################
33 # Set up the test of movem.s
34 ###########################
36 if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then {
41 set objfile [remote_download host tmpdir/thumb2-cond.o]
43 set objfile tmpdir/thumb2-cond.o
46 # Make sure that conditional instructions are correctly decoded.
48 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"]
50 set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr"
52 if [regexp $want $got] then {
53 pass "thumb2-cond test1"
55 fail "thumb2-cond test1"
58 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"]
60 set want "bx\[ \t\]*lr"
62 if [regexp $want $got] then {
63 pass "thumb2-cond test2"
65 fail "thumb2-cond test2"
68 ###########################
69 # Set up the test of multiple disassemblies
70 ###########################
72 if {![binutils_assemble $srcdir/$subdir/simple.s tmpdir/simple.o]} then {
77 set objfile [remote_download host tmpdir/simple.o]
79 set objfile tmpdir/simple.o
82 # Make sure multiple disassemblies come out the same
84 set got [binutils_run $OBJDUMP "-dr $objfile $objfile"]
86 set want "$objfile:\[ \]*file format.*$objfile:\[ \]*file format.*push.*add.*sub.*str.*add.*ldmfd"
88 if [regexp $want $got] then {
89 pass "multiple input files"
91 fail "multiple input files"
94 if {![binutils_assemble $srcdir/$subdir/rvct_symbol.s tmpdir/rvct_symbol.o]} then {
99 set objfile [remote_download host tmpdir/rvct_symbol.o]
101 set objfile tmpdir/rvct_symbol.o
104 # Make sure multiple disassemblies come out the same
106 set got [binutils_run $OBJDUMP "-D $objfile $objfile"]
108 set want "foo.*global_a.*global_b"
110 if [regexp $want $got] then {
111 pass "skip rvct symbol"
113 fail "skip rvct symbol"