1 # Expect script
for ld-spu tests
2 # Copyright
(C
) 2006 Free Software Foundation
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.
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.
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 Foundation
,
16 #
51 Franklin Street
- Fifth Floor
, Boston
, MA
02111-1307, USA.
19 if { ![istarget
"spu-*-*"] } {
25 global AS ASFLAGS
LD LDFLAGS READELF READELFFLAGS
27 set cmd
"$AS $ASFLAGS -o tmpdir/ear.o $srcdir/$subdir/ear.s"
29 set cmdret
[catch
"exec $cmd" comp_output]
30 set comp_output
[prune_warnings $comp_output
]
31 if { $cmdret
!= 0 || $comp_output
!= ""} then {
32 send_log
"$comp_output\n"
33 verbose
"$comp_output" 3
38 set cmd
"$LD $LDFLAGS -o tmpdir/ear tmpdir/ear.o"
40 set cmdret
[catch
"exec $cmd" comp_output]
41 set comp_output
[prune_warnings $comp_output
]
42 if { $cmdret
!= 0 || $comp_output
!= ""} then {
43 send_log
"$comp_output\n"
44 verbose
"$comp_output" 3
49 set cmd
"sh $srcdir/../../binutils/embedspu.sh -m32 ear tmpdir/ear tmpdir/embed.o"
51 set cmdret
[catch
"exec $cmd" comp_output]
52 set comp_output
[prune_warnings $comp_output
]
53 if { $cmdret
!= 0 || $comp_output
!= ""} then {
54 send_log
"$comp_output\n"
55 verbose
"$comp_output" 3
56 if { [regexp
"unknown pseudo-op: `.reloc'" $comp_output] } {
57 untested
"ear embedspu"
64 set cmd
"$READELF $READELFFLAGS -r --wide tmpdir/embed.o > tmpdir/embed.out"
66 set cmdret
[catch
"exec $cmd" comp_output]
67 set comp_output
[prune_warnings $comp_output
]
68 if { $cmdret
!= 0 || $comp_output
!= ""} then {
69 send_log
"$comp_output\n"
70 verbose
"$comp_output" 3
71 fail
"ear embed readelf"
75 if { [regexp_diff
"tmpdir/embed.out" $srcdir/$subdir/embed.rd] } then {
76 fail
"ear embed output"
83 set rd_test_list
[lsort
[glob
-nocomplain $srcdir
/$subdir
/*.d
]]
84 foreach sputest $rd_test_list
{
85 verbose
[file rootname $sputest
]
86 run_dump_test
[file rootname $sputest
]
89 if { [isbuild
"powerpc*-*-linux*"] } {