This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/binutils-gdb.git] / ld / testsuite / ld-versados / versados.exp
1 # Expect script for ld-versados tests
2 # Copyright (C) 1995 Free Software Foundation
3 #
4 # This file 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17 #
18 # Written by Steve Chamberlain (sac@cygnus.com)
19 #
20
21 # Make sure that ld can read versados images and
22 # generate binaries which are identical to the customer's
23 # old method.
24
25 # This test can only be run if ld generates native executables.
26
27 # This test can only be run on 68k coff targets
28 # Square bracket expressions seem to confuse istarget.
29 if { ![istarget m68k-*-coff*] } then {
30 return
31 }
32
33 set testname "LD VERSADOS"
34
35
36 proc inspect { whichone } {
37 global objdump
38 global exec_output
39 global srcdir
40 global subdir
41 global testname
42
43 send_log "$objdump -s tmpdir/$whichone.out >tmpdir/$whichone.dump\n"
44 catch "exec $objdump -s tmpdir/$whichone.out | grep -v srec >tmpdir/$whichone.dump" exec_output
45
46 if ![string match "" $exec_output] {
47 send_log "$exec_output\n"
48 verbose $exec_output
49 unresolved $testname
50 return
51 }
52
53 send_log "$objdump -s $srcdir$subdir/$whichone.ook >tmpdir/$whichone.dok\n"
54 catch "exec $objdump -s $srcdir$subdir/$whichone.ook | grep -v srec >tmpdir/$whichone.dok" exec_output
55
56 if ![string match "" $exec_output] {
57 send_log "$exec_output\n"
58 verbose $exec_output
59 unresolved $testname
60 return
61 }
62
63 # compare it with the correct output
64 catch "exec diff tmpdir/$whichone.dump tmpdir/$whichone.dok" exec_output
65 if ![string match "" $exec_output] {
66 send_log "$exec_output\n"
67 verbose $exec_output
68 fail $testname
69 return
70 }
71
72 }
73
74 if ![ld_simple_link $ld tmpdir/t1.out \
75 " -T $srcdir$subdir/t1.ld $srcdir$subdir/t1-1.ro $srcdir$subdir/t1-2.ro"] {
76 fail $testname
77 } else {
78 # Get a dump of what we've got, and what we should have
79 inspect t1
80 }
81
82
83 if ![ld_simple_link $ld tmpdir/t2.out \
84 " -T $srcdir$subdir/t2.ld $srcdir$subdir/t2-2.ro \
85 $srcdir$subdir/t2-1.ro $srcdir$subdir/t2-3.ro"] {
86 fail $testname
87 } else {
88 # Get a dump of what we've got, and what we should have
89 inspect t2
90 }
91
92 pass $testname
93
94
95
This page took 0.033607 seconds and 4 git commands to generate.