*** empty log message ***
[deliverable/binutils-gdb.git] / ld / testsuite / ld-sh / rd-sh.exp
CommitLineData
7739e068 1# Expect script for run_dump_test based ld-sh tests.
aef6203b 2# Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
7739e068
HPN
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
75be928b 16# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
7739e068
HPN
17#
18# Written by Hans-Peter Nilsson (hp@bitrange.com)
19#
20
21# This file is kept separate from sh.exp, because having it separate
22# simplifies selective testing, like in "make check-ld
23# RUNTESTFLAGS=rd-sh.exp=shared-1". It is assumed that sh.exp is a place
24# for constructs where the name of the test is harder to extract and
25# select than here.
26
27if ![istarget sh*-*-*] {
28 return
29}
30
5e622545 31global ASFLAGS
f19ae42f 32global LDFLAGS
5e622545 33set asflags_save "$ASFLAGS"
f19ae42f 34set ldflags_save "$LDFLAGS"
5e622545 35
935cac6e 36if {[istarget sh64*-*-*] || [istarget sh5*-*-*]} then {
935cac6e 37 set ASFLAGS "$ASFLAGS -isa=SHcompact"
f19ae42f
KK
38 if [istarget sh64*-*-linux*] {
39 set LDFLAGS "$LDFLAGS -mshlelf32_linux"
40 } elseif { [istarget sh64*-*-netbsd*] || [istarget sh5*-*-netbsd*] } {
41 set LDFLAGS "$LDFLAGS -mshlelf32_nbsd -e_start"
42 } else {
43 set LDFLAGS "$LDFLAGS -mshlelf32"
44 }
935cac6e
KK
45}
46
7739e068
HPN
47set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
48foreach shtest $rd_test_list {
49 # We need to strip the ".d", but can leave the dirname.
50 verbose [file rootname $shtest]
51 run_dump_test [file rootname $shtest]
6c381eeb
KK
52 if [string match $srcdir/$subdir/*-dso.d $shtest] {
53 # Copy the output of the DSO-createing test to .so file.
54 # Notice that a DSO-creating test must preceed the tests
55 # which need that DSO in sort-order by name.
56 set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $shtest]].so"
57 send_log "$cmd\n"
58 set cmdret [catch "exec $cmd" comp_output]
59 send_log "$comp_output\n"
60 # FIXME: What if it fails? Need we do something?
61 }
7739e068 62}
935cac6e 63set ASFLAGS "$asflags_save"
f19ae42f 64set LDFLAGS "$ldflags_save"
This page took 0.224581 seconds and 4 git commands to generate.