Commit | Line | Data |
---|---|---|
4b95cf5c | 1 | # Copyright (C) 2004-2014 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 | ||
17 | if {![istarget "arm*-*-*"]} then { | |
18 | return | |
19 | } | |
20 | ||
7f6a71ff | 21 | if {![is_remote host] && [which $OBJDUMP] == 0} then { |
c22aaad1 PB |
22 | perror "$OBJDUMP does not exist" |
23 | return | |
24 | } | |
25 | ||
26 | send_user "Version [binutil_version $OBJDUMP]" | |
27 | ||
28 | ########################### | |
29 | # Set up the test of movem.s | |
30 | ########################### | |
31 | ||
32 | if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then { | |
33 | return | |
34 | } | |
35 | ||
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 | } | |
41 | ||
42 | # Make sure that conditional instructions are correctly decoded. | |
43 | ||
44 | set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"] | |
45 | ||
9401f88d | 46 | set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr" |
c22aaad1 PB |
47 | |
48 | if [regexp $want $got] then { | |
49 | pass "thumb2-cond test1" | |
50 | } else { | |
51 | fail "thumb2-cond test1" | |
52 | } | |
53 | ||
54 | set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"] | |
55 | ||
9401f88d | 56 | set want "bx\[ \t\]*lr" |
c22aaad1 PB |
57 | |
58 | if [regexp $want $got] then { | |
9401f88d | 59 | pass "thumb2-cond test2" |
c22aaad1 | 60 | } else { |
9401f88d | 61 | fail "thumb2-cond test2" |
c22aaad1 | 62 | } |
1fbaefec PB |
63 | |
64 | ########################### | |
65 | # Set up the test of multiple disassemblies | |
66 | ########################### | |
67 | ||
68 | if {![binutils_assemble $srcdir/$subdir/simple.s tmpdir/simple.o]} then { | |
69 | return | |
70 | } | |
71 | ||
72 | if [is_remote host] { | |
73 | set objfile [remote_download host tmpdir/simple.o] | |
74 | } else { | |
75 | set objfile tmpdir/simple.o | |
76 | } | |
77 | ||
78 | # Make sure multiple disassemblies come out the same | |
79 | ||
80 | set got [binutils_run $OBJDUMP "-dr $objfile $objfile"] | |
81 | ||
101af531 | 82 | set want "$objfile:\[ \]*file format.*$objfile:\[ \]*file format.*push.*add.*sub.*str.*add.*ldmfd" |
1fbaefec PB |
83 | |
84 | if [regexp $want $got] then { | |
85 | pass "multiple input files" | |
86 | } else { | |
87 | fail "multiple input files" | |
88 | } |