]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - binutils/testsuite/binutils-all/arm/objdump.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / binutils / testsuite / binutils-all / arm / objdump.exp
CommitLineData
250d07de 1# Copyright (C) 2004-2021 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
7f6a71ff 21if {![is_remote host] && [which $OBJDUMP] == 0} then {
c22aaad1
PB
22 perror "$OBJDUMP does not exist"
23 return
24}
25
26send_user "Version [binutil_version $OBJDUMP]"
27
28###########################
29# Set up the test of movem.s
30###########################
31
32if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then {
f795c494 33 fail "thumb2-cond (assembling)"
c22aaad1 34} else {
c22aaad1 35
f795c494
AM
36 if [is_remote host] {
37 set objfile [remote_download host tmpdir/thumb2-cond.o]
38 } else {
39 set objfile tmpdir/thumb2-cond.o
40 }
c22aaad1 41
f795c494 42 # Make sure that conditional instructions are correctly decoded.
c22aaad1 43
f795c494 44 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"]
c22aaad1 45
f795c494 46 set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr"
c22aaad1 47
f795c494
AM
48 if [regexp $want $got] then {
49 pass "thumb2-cond test1"
50 } else {
51 fail "thumb2-cond test1"
52 }
c22aaad1 53
f795c494 54 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"]
c22aaad1 55
f795c494
AM
56 set want "bx\[ \t\]*lr"
57
58 if [regexp $want $got] then {
59 pass "thumb2-cond test2"
60 } else {
61 fail "thumb2-cond test2"
62 }
c22aaad1 63}
1fbaefec
PB
64
65###########################
66# Set up the test of multiple disassemblies
67###########################
68
69if {![binutils_assemble $srcdir/$subdir/simple.s tmpdir/simple.o]} then {
f795c494 70 fail "multiple input files"
1fbaefec 71} else {
1fbaefec 72
f795c494
AM
73 if [is_remote host] {
74 set objfile [remote_download host tmpdir/simple.o]
75 } else {
76 set objfile tmpdir/simple.o
77 }
1fbaefec 78
f795c494 79 # Make sure multiple disassemblies come out the same
1fbaefec 80
f795c494 81 set got [binutils_run $OBJDUMP "-dr $objfile $objfile"]
1fbaefec 82
f795c494 83 set want "$objfile:\[ \]*file format.*$objfile:\[ \]*file format.*push.*add.*sub.*str.*add.*ldmfd"
d8282f0e 84
f795c494
AM
85 if [regexp $want $got] then {
86 pass "multiple input files"
87 } else {
88 fail "multiple input files"
89 }
d8282f0e
JW
90}
91
f795c494
AM
92if {![binutils_assemble $srcdir/$subdir/rvct_symbol.s tmpdir/rvct_symbol.o]} then {
93 fail "skip rvct symbol"
d8282f0e 94} else {
d8282f0e 95
f795c494
AM
96 if [is_remote host] {
97 set objfile [remote_download host tmpdir/rvct_symbol.o]
98 } else {
99 set objfile tmpdir/rvct_symbol.o
100 }
d8282f0e 101
f795c494 102 # Make sure multiple disassemblies come out the same
d8282f0e 103
f795c494 104 set got [binutils_run $OBJDUMP "-D $objfile $objfile"]
d8282f0e 105
f795c494
AM
106 set want "foo.*global_a.*global_b"
107
108 if [regexp $want $got] then {
109 pass "skip rvct symbol"
110 } else {
111 fail "skip rvct symbol"
112 }
d8282f0e 113}
796d6298
TC
114
115###########################
116# Set up generic test framework
117###########################
118
119set tempfile tmpdir/armtemp.o
120set copyfile tmpdir/armcopy
121
122set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
123foreach t $test_list {
124 # We need to strip the ".d", but can leave the dirname.
125 verbose [file rootname $t]
126 run_dump_test [file rootname $t]
127}