Commit | Line | Data |
---|---|---|
32866df7 | 1 | # Copyright 2004, 2007 |
c22aaad1 PB |
2 | # Free Software Foundation, Inc. |
3 | ||
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
32866df7 | 6 | # the Free Software Foundation; either version 3 of the License, or |
c22aaad1 PB |
7 | # (at your option) any later version. |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. | |
17 | ||
18 | if {![istarget "arm*-*-*"]} then { | |
19 | return | |
20 | } | |
21 | ||
22 | if {[which $OBJDUMP] == 0} then { | |
23 | perror "$OBJDUMP does not exist" | |
24 | return | |
25 | } | |
26 | ||
27 | send_user "Version [binutil_version $OBJDUMP]" | |
28 | ||
29 | ########################### | |
30 | # Set up the test of movem.s | |
31 | ########################### | |
32 | ||
33 | if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then { | |
34 | return | |
35 | } | |
36 | ||
37 | if [is_remote host] { | |
38 | set objfile [remote_download host tmpdir/thumb2-cond.o] | |
39 | } else { | |
40 | set objfile tmpdir/thumb2-cond.o | |
41 | } | |
42 | ||
43 | # Make sure that conditional instructions are correctly decoded. | |
44 | ||
45 | set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"] | |
46 | ||
9401f88d | 47 | set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr" |
c22aaad1 PB |
48 | |
49 | if [regexp $want $got] then { | |
50 | pass "thumb2-cond test1" | |
51 | } else { | |
52 | fail "thumb2-cond test1" | |
53 | } | |
54 | ||
55 | set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"] | |
56 | ||
9401f88d | 57 | set want "bx\[ \t\]*lr" |
c22aaad1 PB |
58 | |
59 | if [regexp $want $got] then { | |
9401f88d | 60 | pass "thumb2-cond test2" |
c22aaad1 | 61 | } else { |
9401f88d | 62 | fail "thumb2-cond test2" |
c22aaad1 | 63 | } |