]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/testsuite/ld-sh/rd-sh.exp
* ld-sh/rd-sh.exp: Add -isa=SHcompact to ASFLAGS for SH-5.
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-sh / rd-sh.exp
1 # Expect script for run_dump_test based ld-sh tests.
2 # Copyright 2001 Free Software Foundation, Inc.
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 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
27 if ![istarget sh*-*-*] {
28 return
29 }
30
31 if {[istarget sh64*-*-*] || [istarget sh5*-*-*]} then {
32 global ASFLAGS
33 set asflags_save "$ASFLAGS"
34 set ASFLAGS "$ASFLAGS -isa=SHcompact"
35 }
36
37 set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
38 foreach shtest $rd_test_list {
39 # We need to strip the ".d", but can leave the dirname.
40 verbose [file rootname $shtest]
41 run_dump_test [file rootname $shtest]
42 if [string match $srcdir/$subdir/*-dso.d $shtest] {
43 # Copy the output of the DSO-createing test to .so file.
44 # Notice that a DSO-creating test must preceed the tests
45 # which need that DSO in sort-order by name.
46 set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $shtest]].so"
47 send_log "$cmd\n"
48 set cmdret [catch "exec $cmd" comp_output]
49 send_log "$comp_output\n"
50 # FIXME: What if it fails? Need we do something?
51 }
52 }
53 set ASFLAGS "$asflags_save"