Update year range in copyright notice of binutils files
[deliverable/binutils-gdb.git] / binutils / testsuite / binutils-all / arm / objdump.exp
CommitLineData
219d1afa 1# Copyright (C) 2004-2018 Free Software Foundation, Inc.
c22aaad1
PB
2
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
32866df7 5# the Free Software Foundation; either version 3 of the License, or
c22aaad1
PB
6# (at your option) any later version.
7#
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.
12#
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.
16
17if {![istarget "arm*-*-*"]} then {
18 return
19}
20
96037eb0
NC
21if {[istarget "*-*-aout"]} then {
22 return
23}
24
7f6a71ff 25if {![is_remote host] && [which $OBJDUMP] == 0} then {
c22aaad1
PB
26 perror "$OBJDUMP does not exist"
27 return
28}
29
30send_user "Version [binutil_version $OBJDUMP]"
31
32###########################
33# Set up the test of movem.s
34###########################
35
36if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then {
f795c494 37 fail "thumb2-cond (assembling)"
c22aaad1 38} else {
c22aaad1 39
f795c494
AM
40 if [is_remote host] {
41 set objfile [remote_download host tmpdir/thumb2-cond.o]
42 } else {
43 set objfile tmpdir/thumb2-cond.o
44 }
c22aaad1 45
f795c494 46 # Make sure that conditional instructions are correctly decoded.
c22aaad1 47
f795c494 48 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"]
c22aaad1 49
f795c494 50 set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr"
c22aaad1 51
f795c494
AM
52 if [regexp $want $got] then {
53 pass "thumb2-cond test1"
54 } else {
55 fail "thumb2-cond test1"
56 }
c22aaad1 57
f795c494 58 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"]
c22aaad1 59
f795c494
AM
60 set want "bx\[ \t\]*lr"
61
62 if [regexp $want $got] then {
63 pass "thumb2-cond test2"
64 } else {
65 fail "thumb2-cond test2"
66 }
c22aaad1 67}
1fbaefec
PB
68
69###########################
70# Set up the test of multiple disassemblies
71###########################
72
73if {![binutils_assemble $srcdir/$subdir/simple.s tmpdir/simple.o]} then {
f795c494 74 fail "multiple input files"
1fbaefec 75} else {
1fbaefec 76
f795c494
AM
77 if [is_remote host] {
78 set objfile [remote_download host tmpdir/simple.o]
79 } else {
80 set objfile tmpdir/simple.o
81 }
1fbaefec 82
f795c494 83 # Make sure multiple disassemblies come out the same
1fbaefec 84
f795c494 85 set got [binutils_run $OBJDUMP "-dr $objfile $objfile"]
1fbaefec 86
f795c494 87 set want "$objfile:\[ \]*file format.*$objfile:\[ \]*file format.*push.*add.*sub.*str.*add.*ldmfd"
d8282f0e 88
f795c494
AM
89 if [regexp $want $got] then {
90 pass "multiple input files"
91 } else {
92 fail "multiple input files"
93 }
d8282f0e
JW
94}
95
f795c494
AM
96if {![binutils_assemble $srcdir/$subdir/rvct_symbol.s tmpdir/rvct_symbol.o]} then {
97 fail "skip rvct symbol"
d8282f0e 98} else {
d8282f0e 99
f795c494
AM
100 if [is_remote host] {
101 set objfile [remote_download host tmpdir/rvct_symbol.o]
102 } else {
103 set objfile tmpdir/rvct_symbol.o
104 }
d8282f0e 105
f795c494 106 # Make sure multiple disassemblies come out the same
d8282f0e 107
f795c494 108 set got [binutils_run $OBJDUMP "-D $objfile $objfile"]
d8282f0e 109
f795c494
AM
110 set want "foo.*global_a.*global_b"
111
112 if [regexp $want $got] then {
113 pass "skip rvct symbol"
114 } else {
115 fail "skip rvct symbol"
116 }
d8282f0e 117}
This page took 0.46252 seconds and 4 git commands to generate.