daily update
[external/binutils.git] / binutils / testsuite / binutils-all / hppa / objdump.exp
1 #   Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2002, 2007, 2009
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
6 # the Free Software Foundation; either version 3 of the License, or
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 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-dejagnu@prep.ai.mit.edu
20
21 # This file was written by Rob Savoye <rob@cygnus.com>
22 # and rewritten by Ian Lance Taylor <ian@cygnus.com>
23
24 if ![istarget hppa*-*-*] then {
25   return
26 }
27
28 # These tests are not suitable for wide mode.
29 if [istarget hppa*w-*-*] then {
30   return
31 }
32
33 # elf hppa assembler doesn't support .subspa
34 if {[istarget *64*-*-*] || [istarget *-*-*elf*] || [istarget *-*-linux*]} then {
35   return
36 }
37
38 if {[which $OBJDUMP] == 0} then {
39     perror "$OBJDUMP does not exist"
40     return
41 }
42
43 send_user "Version [binutil_version $OBJDUMP]"
44
45 if {![binutils_assemble $srcdir/$subdir/addendbug.s tmpdir/addendbug.o]} then {
46     return
47 }
48
49 if [is_remote host] {
50     set objfile [remote_download host tmpdir/addendbug.o]
51 } else {
52     set objfile tmpdir/addendbug.o
53 }
54
55 # Make sure the SOM BFD code sign extends constants in R_DATA_OVERRIDE fixups.
56
57 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -r $objfile"]
58
59 if [istarget hppa*-*-*elf*] then {
60   set want "00000000 R_PARISC_DPREL21L\[        \]+is_idchar\\+0xffffffe0.*"
61 } else {
62   set want "00000000 R_DP_RELATIVE\[    \]+is_idchar\\+0xffffffe0.*"
63 }
64
65
66 if [regexp $want $got] then {
67     pass "addendbug test"
68 } else {
69     fail "addendbug test"
70 }
71
72 ###########################
73 # Set up the test of freg.s
74 ###########################
75
76 if {![binutils_assemble $srcdir/$subdir/freg.s tmpdir/freg.o]} then {
77     return
78 }
79
80 if [is_remote host] {
81     set objfile [remote_download host tmpdir/freg.o]
82 } else {
83     set objfile tmpdir/freg.o
84 }
85
86 # Make sure that we get R float regs like we're supposed to
87
88 set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
89
90 set want "fmpyfadd,sgl fr4,fr4R,fr5R,fr5"
91
92 if [regexp $want $got] then {
93     pass "freg test"
94 } else {
95     fail "freg test"
96 }