OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/gnu-src/binutils-2.18.50/ld/testsuite/ld-xtensa
    from Rev 38 to Rev 156
    Reverse comparison

Rev 38 → Rev 156

/coalesce.t
0,0 → 1,6
SECTIONS
{
.text 0x00000000 : {
*(.literal .text)
}
}
/coalesce1.s
0,0 → 1,15
.global foo
.data
.global g_name
.align 4
g_name:
.word 0xffffffff
.text
.global main
.align 4
main:
entry a5,16
movi a5,20000
movi a6,g_name
call8 foo
ret
/coalesce2.s
0,0 → 1,10
.text
.global foo
.global g_name
.align 4
foo:
entry a5,16
movi a5,20000
movi a6,g_name
movi a7,50000
ret
/lcall.exp
0,0 → 1,114
# Test Xtensa longcall optimization.
# By David Heine, Tensilica, Inc.
# Copyright 2002, 2003, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
if ![istarget "xtensa*-*-*"] {
return
}
 
set testname "LCALL"
 
set OBJDUMPFLAGS "-dr"
 
#
# default_ld_objdump
# run objdump on a file
#
proc default_ld_objdump { objdump object outputfile } {
global OBJDUMPFLAGS
global objdump_output
global host_triplet
 
if {[which $objdump] == 0} then {
perror "$objdump does not exist"
return 0
}
 
if ![info exists OBJDUMPFLAGS] { set OBJDUMPFLAGS "" }
 
verbose -log "$objdump $OBJDUMPFLAGS $object >$outputfile"
 
catch "exec $objdump $OBJDUMPFLAGS $object >$outputfile" exec_output
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
return 1
} else {
verbose -log "$exec_output"
perror "$object: objdump failed"
return 0
}
}
 
 
if ![ld_assemble $as $srcdir/$subdir/lcall1.s tmpdir/lcall1.o] {
unresolved $testname
return
}
if ![ld_assemble $as $srcdir/$subdir/lcall2.s tmpdir/lcall2.o] {
unresolved $testname
return
}
 
set object "tmpdir/lcall"
set outputfile "$object.txt"
 
if ![ld_simple_link $ld $object "-T $srcdir/$subdir/lcall.t tmpdir/lcall1.o tmpdir/lcall2.o"] {
verbose -log "failure in ld"
fail $testname
return
}
 
if ![default_ld_objdump $objdump $object $outputfile ] {
verbose -log "failure in objdump"
fail $testname
return
}
 
set file [open $outputfile r]
while { [gets $file line] != -1 } {
# verbose "$line" 2
if [regexp "l32r" $line] {
verbose -log "Found an l32r in the linked object"
verbose -log "$line"
fail $testname
}
}
close $file
pass $testname
 
 
set testname "LCALL2"
set file [open $outputfile r]
set found 0
 
while { [gets $file line] != -1 } {
# verbose "$line" 2
if [regexp "^00000004 <label1>:" $line] {
set found 1
}
}
close $file
if $found {
pass $testname
} else {
fail $testname
}
 
/coalesce.exp
0,0 → 1,100
# Test literal coaslescing for Xtensa targets.
# By David Heine, Tensilica, Inc.
# Copyright 2002, 2003, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
if ![istarget "xtensa*-*-*"] {
return
}
 
set testname "COALESCE"
 
set OBJDUMPFLAGS "-dr"
 
#
# default_ld_objdump
# run objdump on a file
#
proc default_ld_objdump { objdump object outputfile } {
global OBJDUMPFLAGS
global objdump_output
global host_triplet
 
if {[which $objdump] == 0} then {
perror "$objdump does not exist"
return 0
}
 
if ![info exists OBJDUMPFLAGS] { set OBJDUMPFLAGS "" }
 
verbose -log "$objdump $OBJDUMPFLAGS $object >$outputfile"
 
catch "exec $objdump $OBJDUMPFLAGS $object >$outputfile" exec_output
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
return 1
} else {
verbose -log "$exec_output"
perror "$object: objdump failed"
return 0
}
}
 
 
if ![ld_assemble $as $srcdir/$subdir/coalesce1.s tmpdir/coalesce1.o] {
unresolved $testname
return
}
if ![ld_assemble $as $srcdir/$subdir/coalesce2.s tmpdir/coalesce2.o] {
unresolved $testname
return
}
 
set object "tmpdir/coalesce"
set outputfile "$object.txt"
 
if ![ld_simple_link $ld $object "-T $srcdir/$subdir/coalesce.t tmpdir/coalesce1.o tmpdir/coalesce2.o"] {
verbose -log "failure in ld"
fail $testname
return
}
 
if ![default_ld_objdump $objdump $object $outputfile ] {
verbose -log "failure in objdump"
fail $testname
return
}
 
set file [open $outputfile r]
set found 0
 
while { [gets $file line] != -1 } {
# verbose "$line" 2
if [regexp "^0000000c <main>:" $line] {
set found 1
}
}
close $file
if $found {
pass $testname
} else {
fail $testname
}
 
/lcall.t
0,0 → 1,6
SECTIONS
{
.text 0x00000000 : {
*(.literal .text)
}
}
/lcall1.s
0,0 → 1,10
.global foo
.text
.align 4
label1:
.literal .Lunused, 0xffffffff
entry a5,16
.begin longcalls
call4 foo
.end longcalls
nop
/lcall2.s
0,0 → 1,6
.global foo
.align 4
foo:
entry a5,16
nop
ret

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.