1 # Test literal coaslescing for Xtensa targets.
2 # By David Heine, Tensilica, Inc.
4 # Free Software Foundation, Inc.
6 # This file 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 set testname "COALESCE"
22 set OBJDUMPFLAGS "-dr"
26 # run objdump on a file
28 proc default_ld_objdump { objdump object outputfile } {
33 if {[which $objdump] == 0} then {
34 perror "$objdump does not exist"
38 if ![info exists OBJDUMPFLAGS] { set OBJDUMPFLAGS "" }
40 verbose -log "$objdump $OBJDUMPFLAGS $object >$outputfile"
42 catch "exec $objdump $OBJDUMPFLAGS $object >$outputfile" exec_output
43 set exec_output [prune_warnings $exec_output]
44 if [string match "" $exec_output] then {
47 verbose -log "$exec_output"
48 perror "$object: objdump failed"
54 if ![ld_assemble $as $srcdir/$subdir/coalesce1.s tmpdir/coalesce1.o] {
58 if ![ld_assemble $as $srcdir/$subdir/coalesce2.s tmpdir/coalesce2.o] {
63 set object "tmpdir/coalesce"
64 set outputfile "$object.txt"
66 if ![ld_simple_link $ld $object "-T $srcdir/$subdir/coalesce.t tmpdir/coalesce1.o tmpdir/coalesce2.o"] {
67 verbose -log "failure in ld"
72 if ![default_ld_objdump $objdump $object $outputfile ] {
73 verbose -log "failure in objdump"
78 set file [open $outputfile r]
81 while { [gets $file line] != -1 } {
83 if [regexp "^0000000c <main>:" $line] {