dd81633246089da4eb94c597b52f6da7a30c8475
[deliverable/binutils-gdb.git] / binutils / testsuite / binutils-all / vax / objdump.exp
1 #
2 # Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2002, 2005
3 # Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #
19
20 #
21 # This file was written by Jan-Benedict Glaw <jbglaw@lug-owl.de>. It's goal
22 # is to check the VAX-specific support of the -M entry:0xf00 switch, which
23 # allows to force function entry masks at given addresses.
24 #
25
26 if ![istarget vax*-*-*] then {
27 return
28 }
29
30 if {[which $OBJDUMP] == 0} then {
31 perror "$OBJDUMP does not exist"
32 return
33 }
34
35 send_user "Version [binutil_version $OBJDUMP]"
36
37 if {![binutils_assemble $srcdir/$subdir/entrymask.s tmpdir/entrymask.o]} then {
38 return
39 }
40
41 if [is_remote host] {
42 set objfile [remote_download host tmpdir/entrymask.o]
43 } else {
44 set objfile tmpdir/entrymask.o
45 }
46
47 #
48 # First run. We expect the function to be a function and the sole label
49 # not to produce an entry mask.
50 #
51 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d $objfile"]
52 set want1 "\[ \]+0:\[ \]+10 01\[ \]+bsbb 3"
53 set want2 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
54 if [regexp $want1 $got] then {
55 pass "entrymask test 1"
56 } else {
57 fail "entrymask test 1"
58 }
59 if [regexp $want2 $got] then {
60 pass "entrymask test 2"
61 } else {
62 fail "entrymask test 2"
63 }
64
65 #
66 # Second run. Now, we force the label as a function, so we expect that
67 # it also produces an entry mask, as any call'able function should.
68 #
69 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 $objfile"]
70 set want3 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
71 set want4 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
72 if [regexp $want3 $got] then {
73 pass "entrymask test 3"
74 } else {
75 fail "entrymask test 3"
76 }
77 if [regexp $want4 $got] then {
78 pass "entrymask test 4"
79 } else {
80 fail "entrymask test 4"
81 }
82
This page took 0.054722 seconds and 3 git commands to generate.