1 # Test Xtensa longcall optimization.
2 # By David Heine
, Tensilica
, Inc.
3 # Copyright
2002, 2003, 2007
4 # Free Software Foundation
, Inc.
6 # This file is part of the GNU Binutils.
8 # This
program is free software
; you can redistribute it and
/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation
; either version
3 of the License
, or
11 #
(at your option
) any later version.
13 # This
program is distributed in the hope that it will be useful
,
14 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License
for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this
program; if not
, write to the Free Software
20 # Foundation
, Inc.
, 51 Franklin Street
- Fifth Floor
, Boston
,
23 if ![istarget
"xtensa-*-*"] {
29 set OBJDUMPFLAGS
"-dr"
33 # run objdump
on a file
35 proc default_ld_objdump
{ objdump object outputfile
} {
40 if {[which $objdump
] == 0} then {
41 perror
"$objdump does not exist"
45 if ![info exists OBJDUMPFLAGS
] { set OBJDUMPFLAGS
"" }
47 verbose
-log "$objdump $OBJDUMPFLAGS $object >$outputfile"
49 catch
"exec $objdump $OBJDUMPFLAGS $object >$outputfile" exec_output
50 set exec_output
[prune_warnings $exec_output
]
51 if [string match
"" $exec_output] then {
54 verbose
-log "$exec_output"
55 perror
"$object: objdump failed"
61 if ![ld_assemble $as $srcdir
/$subdir
/lcall1.s tmpdir
/lcall1.o
] {
65 if ![ld_assemble $as $srcdir
/$subdir
/lcall2.s tmpdir
/lcall2.o
] {
70 set object
"tmpdir/lcall"
71 set outputfile
"$object.txt"
73 if ![ld_simple_link $
ld $object
"-T $srcdir/$subdir/lcall.t tmpdir/lcall1.o tmpdir/lcall2.o"] {
74 verbose
-log "failure in ld"
79 if ![default_ld_objdump $objdump $object $outputfile
] {
80 verbose
-log "failure in objdump"
85 set file
[open $outputfile r
]
86 while { [gets $file line
] != -1 } {
88 if [regexp
"l32r" $line] {
89 verbose
-log "Found an l32r in the linked object"
99 set file
[open $outputfile r
]
102 while { [gets $file line
] != -1 } {
104 if [regexp
"^00000004 <label1>:" $line] {