1 # Expect script
for ld-spu tests
2 # Copyright
(C
) 2006-2022 Free Software Foundation
, Inc.
4 # This file is part of the GNU Binutils.
6 # This
program is free software
; you can redistribute it and
/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation
; either version
3 of the License
, or
9 #
(at your option
) any later version.
11 # This
program is distributed in the hope that it will be useful
,
12 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License
for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this
program; if not
, write to the Free Software
18 # Foundation
, Inc.
, 51 Franklin Street
- Fifth Floor
, Boston
,
22 if { ![istarget
"spu-*-*"] } {
28 global AS ASFLAGS
LD LDFLAGS READELF READELFFLAGS
30 set cmd
"$AS $ASFLAGS -o tmpdir/ear.o $srcdir/$subdir/ear.s"
32 set cmdret
[catch
"exec $cmd" comp_output]
33 set comp_output
[prune_warnings $comp_output
]
34 if { $cmdret
!= 0 || $comp_output
!= ""} then {
35 send_log
"$comp_output\n"
36 verbose
"$comp_output" 3
41 set cmd
"$LD $LDFLAGS -o tmpdir/ear tmpdir/ear.o"
43 set cmdret
[catch
"exec $cmd" comp_output]
44 set comp_output
[prune_warnings $comp_output
]
45 if { $cmdret
!= 0 || $comp_output
!= ""} then {
46 send_log
"$comp_output\n"
47 verbose
"$comp_output" 3
52 set cmd
"sh $srcdir/../../binutils/embedspu.sh -m32 ear tmpdir/ear tmpdir/embed.o"
54 set cmdret
[catch
"exec $cmd" comp_output]
55 set comp_output
[prune_warnings $comp_output
]
56 if { $cmdret
!= 0 || $comp_output
!= ""} then {
57 send_log
"$comp_output\n"
58 verbose
"$comp_output" 3
59 if { [regexp
"unknown pseudo-op: `.reloc'" $comp_output] } {
60 untested
"ear embedspu"
67 set cmd
"$READELF $READELFFLAGS -r --wide tmpdir/embed.o > tmpdir/embed.out"
69 set cmdret
[catch
"exec $cmd" comp_output]
70 set comp_output
[prune_warnings $comp_output
]
71 if { $cmdret
!= 0 || $comp_output
!= ""} then {
72 send_log
"$comp_output\n"
73 verbose
"$comp_output" 3
74 fail
"ear embed readelf"
78 if { [regexp_diff
"tmpdir/embed.out" $srcdir/$subdir/embed.rd] } then {
79 fail
"ear embed output"
86 set rd_test_list
[lsort
[glob
-nocomplain $srcdir
/$subdir
/*.d
]]
87 foreach sputest $rd_test_list
{
88 verbose
[file rootname $sputest
]
89 run_dump_test
[file rootname $sputest
]
92 if { [isbuild
"powerpc*-*-linux*"] } {