From: Joern Rennecke Date: Tue, 29 Jun 2004 16:35:05 +0000 (+0000) Subject: gas/testsuite: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b9b7d81090bd69cb9f5f9c2325a4dcc8fb0764f;p=binutils-gdb.git gas/testsuite: Actually add these files: 2004-05-28 Andrew Stubbs * testsuite/gas/sh/arch: New directory. * testsuite/gas/sh/arch/arch.exp: New test script. * testsuite/gas/sh/arch/arch_expected.txt: New file. * testsuite/gas/sh/arch/sh.s: New file. * testsuite/gas/sh/arch/sh2.s: New file. * testsuite/gas/sh/arch/sh-dsp.s: New file. * testsuite/gas/sh/arch/sh2e.s: New file. * testsuite/gas/sh/arch/sh3-nommu.s: New file. * testsuite/gas/sh/arch/sh3.s: New file. * testsuite/gas/sh/arch/sh3-dsp.s: New file. * testsuite/gas/sh/arch/sh3e.s: New file. * testsuite/gas/sh/arch/sh4-nommu-nofpu.s: New file. * testsuite/gas/sh/arch/sh4-nofpu.s: New file. * testsuite/gas/sh/arch/sh4.s: New file. * testsuite/gas/sh/arch/sh4a-nofpu.s: New file. * testsuite/gas/sh/arch/sh4al-dsp.s: New file. ld/testsuite: Actually add these files: 2004-05-28 Andrew Stubbs * testsuite/ld-sh/arch/arch.exp: New test script. * testsuite/ld-sh/arch/arch_expected.txt: New file. * testsuite/ld-sh/arch/sh.s: New file. * testsuite/ld-sh/arch/sh2.s: New file. * testsuite/ld-sh/arch/sh-dsp.s: New file. * testsuite/ld-sh/arch/sh2e.s: New file. * testsuite/ld-sh/arch/sh3-nommu.s: New file. * testsuite/ld-sh/arch/sh3.s: New file. * testsuite/ld-sh/arch/sh3-dsp.s: New file. * testsuite/ld-sh/arch/sh3e.s: New file. * testsuite/ld-sh/arch/sh4-nommu-nofpu.s: New file. * testsuite/ld-sh/arch/sh4-nofpu.s: New file. * testsuite/ld-sh/arch/sh4.s: New file. * testsuite/ld-sh/arch/sh4a-nofpu.s: New file. * testsuite/ld-sh/arch/sh4al-dsp.s: New file. * testsuite/ld-sh/arch/sh4a.s: New file. --- diff --git a/gas/testsuite/gas/sh/arch/arch.exp b/gas/testsuite/gas/sh/arch/arch.exp new file mode 100644 index 00000000000..db0aa0163eb --- /dev/null +++ b/gas/testsuite/gas/sh/arch/arch.exp @@ -0,0 +1,197 @@ +# Copyright (C) 2004 +# Free Software Foundation, Inc. + +# 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# dejagnu@gnu.org + +# This scripts tests all available SH architectures with all the assembler +# options related to the architecture. It ensures that those combinations +# which should not work do not work, and that those that should work +# produce the correct output architecture. +# +# It looks for files in the same directory as this file named sh*.s . +# Each file must contain one or more instructions which uniquely identifies +# that architecture. The architecture name is inferred from the file name. +# +# The script generates the architecture/option permutations automatically, +# but it reads the expected results from the file arch_expected.txt (also +# found in the same directory as this script). +# +# The arch_expected.txt file should NOT be hand edited. Whenever the script +# is run (e.g. with 'make check') it creates a new (usually identical) file +# named arch_results.txt in the /gas/testsuite directory. When the +# expected results change (or new architectures are added) this new file +# can be used to replace arch_expected.txt with no modification required. + + +# The procedure extracts the architecture name from the objdump output. +# If there is no architecture name (or objdump output changes significantly) +# then the behaviour is undefined, but it will most likely return junk. + +proc get_sh_arch { ofile } { + global comp_output + + objdump "-f $ofile" + send_log $comp_output + + set comp_output [string replace $comp_output 0 \ + [expr [string first "architecture:" $comp_output] + 13] ""] + + return [string range $comp_output 0 [expr [string first "," $comp_output] - 1]] +} + + +# This procedure runs two tests: +# Test 1: Check the assembler can assemble the given file with +# given options. +# Test 2: Check that the resultant architecture is as expected. +# It also writes an entry to the arch_results.txt file. + +proc test_arch { file opt arch resultfile } { + global comp_output + + set name [file tail $file] + set rootname [file rootname $name] + + if [string equal $opt "default-options"] then { + gas_run $name "-o ${rootname}-#${opt}#.o" "" + } else { + gas_run $name "$opt -o ${rootname}-#${opt}#.o" "" + } + + if [want_no_output "$rootname file should assemble with $opt"] then { + set result [get_sh_arch "${rootname}-#${opt}#.o"] + puts $resultfile [format "%-20s %-25s %s" $file $opt $result] + + if {$result == $arch} then { + pass "$rootname file with $opt should assemble to arch $arch" + file delete "${rootname}-#${opt}#.o" + } else { + send_log $comp_output + fail "$rootname file with $opt should assemble to arch $arch" + } + } else { + puts $resultfile [format "%-20s %-25s ERROR" $file $opt] + untested "$rootname file with $opt should assemble to arch $arch" + } + +} + + +# This procedure tests that a file that is not suposed to assemble +# with a given option does, in fact, not assemble. +# It also writes an entry to the arch_results.txt file. + +proc test_arch_error { file opt resultfile} { + global comp_output + + set name [file tail $file] + set rootname [file rootname $name] + + if [string equal $opt "default-options"] then { + gas_run $name "-o ${rootname}-#${opt}#.o" "" + } else { + gas_run $name "$opt -o ${rootname}-#${opt}#.o" "" + } + + if [string match "" $comp_output] then { + fail "$rootname file with $opt should not assemble" + puts $resultfile [format "%-20s %-25s [get_sh_arch ${rootname}-#${opt}#.o]" $file $opt] + } else { + pass "$rootname file with $opt should not assemble" + puts $resultfile [format "%-20s %-25s ERROR" $file $opt] + } +} + +# These tests are not suitable for sh-coff because +# coff does not store the architecture information. + +if [istarget sh*-*-elf] then { + global subdir srcdir + + # Find all the architectures and generate the + # list of options we will test. + + set filelist [lsort -ascii [glob "$srcdir/$subdir/sh*.s"]] + set optlist {"default-options" "-dsp" "-isa=any" "-isa=dsp" "-isa=fp"} + foreach file $filelist { + set arch [file rootname [file tail $file]] + lappend optlist "-isa=$arch" "-isa=${arch}-up" + } + + # Initialise the results file + + set outfile [open "arch_results.txt" w 0666] + puts $outfile "# Generated file. DO NOT EDIT" + puts $outfile "#" + puts $outfile "# This file is generated by gas/testsuite/gas/sh/arch/arch.exp ." + puts $outfile "# It contains the expected results of the tests." + puts $outfile "# If the tests are failing because the expected results" + puts $outfile "# have changed then run 'make check' and copy the new file" + puts $outfile "# from /gas/testsuite/arch_results.txt" + puts $outfile "# to /gas/testsuite/gas/sh/arch/arch_expected.txt ." + puts $outfile "# Make sure the new expected results are ALL correct." + puts $outfile "#" + puts $outfile [format "# %-18s %-25s %s" "FILE" "OPTION" "OUTPUT"] + puts $outfile [format "# %-18s %-25s %s" "----" "------" "------"] + + # Open the expected results file and skip the header + + set infile [open "$srcdir/$subdir/arch_expected.txt" r] + while {[gets $infile line] >= 0 && [string match {\#*} $line]} {send_log "reading '$line'\n"} + + foreach file $filelist { + foreach opt $optlist { + set name [file tail $file] + set rootname [file rootname $name] + + # Decode the expected result from the file + + scan $line "%s %s %s" exfile exopt exarch + send_log "exfile = '$exfile', exopt = '$exopt', exarch = '$exarch'\n" + send_log " name = '$name', opt = '$opt'\n" + + if {[string equal $exfile $name] && [string equal $exopt $opt]} then { + # The expected result file makes sense and + # appears up-to-date (the file and options match) + + if {[string equal $exarch "ERROR"]} then { + test_arch_error $name $opt $outfile + } else { + test_arch $name $opt $exarch $outfile + } + } else { + # The expected result file isn't right somehow + # so just try any old test. This will cause + # many failures, but will genrate the results file. + + test_arch $name $opt $rootname $outfile + } + + # Read the next line from the expected result file. + # This is at the end because the process of skipping + # the header reads the first real line + + if [gets $infile line] then { + send_log "reading '$line'\n" + } + } + } + + close $infile + close $outfile +} diff --git a/gas/testsuite/gas/sh/arch/arch_expected.txt b/gas/testsuite/gas/sh/arch/arch_expected.txt new file mode 100644 index 00000000000..6a6ec7c01e0 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/arch_expected.txt @@ -0,0 +1,474 @@ +# Generated file. DO NOT EDIT +# +# This file is generated by gas/testsuite/gas/sh/arch/arch.exp . +# It contains the expected results of the tests. +# If the tests are failing because the expected results +# have changed then run 'make check' and copy the new file +# from /gas/testsuite/arch_results.txt +# to /gas/testsuite/gas/sh/arch/arch_expected.txt . +# Make sure the new expected results are ALL correct. +# +# FILE OPTION OUTPUT +# ---- ------ ------ +sh-dsp.s default-options ERROR +sh-dsp.s -dsp sh-dsp +sh-dsp.s -isa=any sh-dsp +sh-dsp.s -isa=dsp sh-dsp +sh-dsp.s -isa=fp ERROR +sh-dsp.s -isa=sh-dsp sh-dsp +sh-dsp.s -isa=sh-dsp-up sh-dsp +sh-dsp.s -isa=sh ERROR +sh-dsp.s -isa=sh-up sh-dsp +sh-dsp.s -isa=sh2 ERROR +sh-dsp.s -isa=sh2-up sh-dsp +sh-dsp.s -isa=sh2e ERROR +sh-dsp.s -isa=sh2e-up ERROR +sh-dsp.s -isa=sh3-dsp sh3-dsp +sh-dsp.s -isa=sh3-dsp-up sh3-dsp +sh-dsp.s -isa=sh3-nommu ERROR +sh-dsp.s -isa=sh3-nommu-up sh3-dsp +sh-dsp.s -isa=sh3 ERROR +sh-dsp.s -isa=sh3-up sh3-dsp +sh-dsp.s -isa=sh3e ERROR +sh-dsp.s -isa=sh3e-up ERROR +sh-dsp.s -isa=sh4-nofpu ERROR +sh-dsp.s -isa=sh4-nofpu-up sh4al-dsp +sh-dsp.s -isa=sh4-nommu-nofpu ERROR +sh-dsp.s -isa=sh4-nommu-nofpu-up sh4al-dsp +sh-dsp.s -isa=sh4 ERROR +sh-dsp.s -isa=sh4-up ERROR +sh-dsp.s -isa=sh4a-nofpu ERROR +sh-dsp.s -isa=sh4a-nofpu-up sh4al-dsp +sh-dsp.s -isa=sh4a ERROR +sh-dsp.s -isa=sh4a-up ERROR +sh-dsp.s -isa=sh4al-dsp sh4al-dsp +sh-dsp.s -isa=sh4al-dsp-up sh4al-dsp +sh.s default-options sh +sh.s -dsp sh +sh.s -isa=any sh +sh.s -isa=dsp sh +sh.s -isa=fp sh +sh.s -isa=sh-dsp sh-dsp +sh.s -isa=sh-dsp-up sh-dsp +sh.s -isa=sh sh +sh.s -isa=sh-up sh +sh.s -isa=sh2 sh2 +sh.s -isa=sh2-up sh2 +sh.s -isa=sh2e sh2e +sh.s -isa=sh2e-up sh2e +sh.s -isa=sh3-dsp sh3-dsp +sh.s -isa=sh3-dsp-up sh3-dsp +sh.s -isa=sh3-nommu sh3-nommu +sh.s -isa=sh3-nommu-up sh3-nommu +sh.s -isa=sh3 sh3 +sh.s -isa=sh3-up sh3 +sh.s -isa=sh3e sh3e +sh.s -isa=sh3e-up sh3e +sh.s -isa=sh4-nofpu sh4-nofpu +sh.s -isa=sh4-nofpu-up sh4-nofpu +sh.s -isa=sh4-nommu-nofpu sh4-nommu-nofpu +sh.s -isa=sh4-nommu-nofpu-up sh4-nommu-nofpu +sh.s -isa=sh4 sh4 +sh.s -isa=sh4-up sh4 +sh.s -isa=sh4a-nofpu sh4a-nofpu +sh.s -isa=sh4a-nofpu-up sh4a-nofpu +sh.s -isa=sh4a sh4a +sh.s -isa=sh4a-up sh4a +sh.s -isa=sh4al-dsp sh4al-dsp +sh.s -isa=sh4al-dsp-up sh4al-dsp +sh2.s default-options sh2 +sh2.s -dsp sh2 +sh2.s -isa=any sh2 +sh2.s -isa=dsp sh2 +sh2.s -isa=fp sh2 +sh2.s -isa=sh-dsp sh-dsp +sh2.s -isa=sh-dsp-up sh-dsp +sh2.s -isa=sh ERROR +sh2.s -isa=sh-up sh2 +sh2.s -isa=sh2 sh2 +sh2.s -isa=sh2-up sh2 +sh2.s -isa=sh2e sh2e +sh2.s -isa=sh2e-up sh2e +sh2.s -isa=sh3-dsp sh3-dsp +sh2.s -isa=sh3-dsp-up sh3-dsp +sh2.s -isa=sh3-nommu sh3-nommu +sh2.s -isa=sh3-nommu-up sh3-nommu +sh2.s -isa=sh3 sh3 +sh2.s -isa=sh3-up sh3 +sh2.s -isa=sh3e sh3e +sh2.s -isa=sh3e-up sh3e +sh2.s -isa=sh4-nofpu sh4-nofpu +sh2.s -isa=sh4-nofpu-up sh4-nofpu +sh2.s -isa=sh4-nommu-nofpu sh4-nommu-nofpu +sh2.s -isa=sh4-nommu-nofpu-up sh4-nommu-nofpu +sh2.s -isa=sh4 sh4 +sh2.s -isa=sh4-up sh4 +sh2.s -isa=sh4a-nofpu sh4a-nofpu +sh2.s -isa=sh4a-nofpu-up sh4a-nofpu +sh2.s -isa=sh4a sh4a +sh2.s -isa=sh4a-up sh4a +sh2.s -isa=sh4al-dsp sh4al-dsp +sh2.s -isa=sh4al-dsp-up sh4al-dsp +sh2e.s default-options sh2e +sh2e.s -dsp ERROR +sh2e.s -isa=any sh2e +sh2e.s -isa=dsp ERROR +sh2e.s -isa=fp sh2e +sh2e.s -isa=sh-dsp ERROR +sh2e.s -isa=sh-dsp-up ERROR +sh2e.s -isa=sh ERROR +sh2e.s -isa=sh-up sh2e +sh2e.s -isa=sh2 ERROR +sh2e.s -isa=sh2-up sh2e +sh2e.s -isa=sh2e sh2e +sh2e.s -isa=sh2e-up sh2e +sh2e.s -isa=sh3-dsp ERROR +sh2e.s -isa=sh3-dsp-up ERROR +sh2e.s -isa=sh3-nommu ERROR +sh2e.s -isa=sh3-nommu-up sh3e +sh2e.s -isa=sh3 ERROR +sh2e.s -isa=sh3-up sh3e +sh2e.s -isa=sh3e sh3e +sh2e.s -isa=sh3e-up sh3e +sh2e.s -isa=sh4-nofpu ERROR +sh2e.s -isa=sh4-nofpu-up sh4 +sh2e.s -isa=sh4-nommu-nofpu ERROR +sh2e.s -isa=sh4-nommu-nofpu-up sh4 +sh2e.s -isa=sh4 sh4 +sh2e.s -isa=sh4-up sh4 +sh2e.s -isa=sh4a-nofpu ERROR +sh2e.s -isa=sh4a-nofpu-up sh4a +sh2e.s -isa=sh4a sh4a +sh2e.s -isa=sh4a-up sh4a +sh2e.s -isa=sh4al-dsp ERROR +sh2e.s -isa=sh4al-dsp-up ERROR +sh3-dsp.s default-options ERROR +sh3-dsp.s -dsp sh3-dsp +sh3-dsp.s -isa=any sh3-dsp +sh3-dsp.s -isa=dsp sh3-dsp +sh3-dsp.s -isa=fp ERROR +sh3-dsp.s -isa=sh-dsp ERROR +sh3-dsp.s -isa=sh-dsp-up sh3-dsp +sh3-dsp.s -isa=sh ERROR +sh3-dsp.s -isa=sh-up sh3-dsp +sh3-dsp.s -isa=sh2 ERROR +sh3-dsp.s -isa=sh2-up sh3-dsp +sh3-dsp.s -isa=sh2e ERROR +sh3-dsp.s -isa=sh2e-up ERROR +sh3-dsp.s -isa=sh3-dsp sh3-dsp +sh3-dsp.s -isa=sh3-dsp-up sh3-dsp +sh3-dsp.s -isa=sh3-nommu ERROR +sh3-dsp.s -isa=sh3-nommu-up sh3-dsp +sh3-dsp.s -isa=sh3 ERROR +sh3-dsp.s -isa=sh3-up sh3-dsp +sh3-dsp.s -isa=sh3e ERROR +sh3-dsp.s -isa=sh3e-up ERROR +sh3-dsp.s -isa=sh4-nofpu ERROR +sh3-dsp.s -isa=sh4-nofpu-up sh4al-dsp +sh3-dsp.s -isa=sh4-nommu-nofpu ERROR +sh3-dsp.s -isa=sh4-nommu-nofpu-up sh4al-dsp +sh3-dsp.s -isa=sh4 ERROR +sh3-dsp.s -isa=sh4-up ERROR +sh3-dsp.s -isa=sh4a-nofpu ERROR +sh3-dsp.s -isa=sh4a-nofpu-up sh4al-dsp +sh3-dsp.s -isa=sh4a ERROR +sh3-dsp.s -isa=sh4a-up ERROR +sh3-dsp.s -isa=sh4al-dsp sh4al-dsp +sh3-dsp.s -isa=sh4al-dsp-up sh4al-dsp +sh3-nommu.s default-options sh3-nommu +sh3-nommu.s -dsp sh3-nommu +sh3-nommu.s -isa=any sh3-nommu +sh3-nommu.s -isa=dsp sh3-nommu +sh3-nommu.s -isa=fp sh3-nommu +sh3-nommu.s -isa=sh-dsp ERROR +sh3-nommu.s -isa=sh-dsp-up sh3-dsp +sh3-nommu.s -isa=sh ERROR +sh3-nommu.s -isa=sh-up sh3-nommu +sh3-nommu.s -isa=sh2 ERROR +sh3-nommu.s -isa=sh2-up sh3-nommu +sh3-nommu.s -isa=sh2e ERROR +sh3-nommu.s -isa=sh2e-up sh3e +sh3-nommu.s -isa=sh3-dsp sh3-dsp +sh3-nommu.s -isa=sh3-dsp-up sh3-dsp +sh3-nommu.s -isa=sh3-nommu sh3-nommu +sh3-nommu.s -isa=sh3-nommu-up sh3-nommu +sh3-nommu.s -isa=sh3 sh3 +sh3-nommu.s -isa=sh3-up sh3 +sh3-nommu.s -isa=sh3e sh3e +sh3-nommu.s -isa=sh3e-up sh3e +sh3-nommu.s -isa=sh4-nofpu sh4-nofpu +sh3-nommu.s -isa=sh4-nofpu-up sh4-nofpu +sh3-nommu.s -isa=sh4-nommu-nofpu sh4-nommu-nofpu +sh3-nommu.s -isa=sh4-nommu-nofpu-up sh4-nommu-nofpu +sh3-nommu.s -isa=sh4 sh4 +sh3-nommu.s -isa=sh4-up sh4 +sh3-nommu.s -isa=sh4a-nofpu sh4a-nofpu +sh3-nommu.s -isa=sh4a-nofpu-up sh4a-nofpu +sh3-nommu.s -isa=sh4a sh4a +sh3-nommu.s -isa=sh4a-up sh4a +sh3-nommu.s -isa=sh4al-dsp sh4al-dsp +sh3-nommu.s -isa=sh4al-dsp-up sh4al-dsp +sh3.s default-options sh3 +sh3.s -dsp sh3 +sh3.s -isa=any sh3 +sh3.s -isa=dsp sh3 +sh3.s -isa=fp sh3 +sh3.s -isa=sh-dsp ERROR +sh3.s -isa=sh-dsp-up sh3-dsp +sh3.s -isa=sh ERROR +sh3.s -isa=sh-up sh3 +sh3.s -isa=sh2 ERROR +sh3.s -isa=sh2-up sh3 +sh3.s -isa=sh2e ERROR +sh3.s -isa=sh2e-up sh3e +sh3.s -isa=sh3-dsp sh3-dsp +sh3.s -isa=sh3-dsp-up sh3-dsp +sh3.s -isa=sh3-nommu ERROR +sh3.s -isa=sh3-nommu-up sh3 +sh3.s -isa=sh3 sh3 +sh3.s -isa=sh3-up sh3 +sh3.s -isa=sh3e sh3e +sh3.s -isa=sh3e-up sh3e +sh3.s -isa=sh4-nofpu sh4-nofpu +sh3.s -isa=sh4-nofpu-up sh4-nofpu +sh3.s -isa=sh4-nommu-nofpu ERROR +sh3.s -isa=sh4-nommu-nofpu-up sh4-nofpu +sh3.s -isa=sh4 sh4 +sh3.s -isa=sh4-up sh4 +sh3.s -isa=sh4a-nofpu sh4a-nofpu +sh3.s -isa=sh4a-nofpu-up sh4a-nofpu +sh3.s -isa=sh4a sh4a +sh3.s -isa=sh4a-up sh4a +sh3.s -isa=sh4al-dsp sh4al-dsp +sh3.s -isa=sh4al-dsp-up sh4al-dsp +sh3e.s default-options sh3e +sh3e.s -dsp ERROR +sh3e.s -isa=any sh3e +sh3e.s -isa=dsp ERROR +sh3e.s -isa=fp sh3e +sh3e.s -isa=sh-dsp ERROR +sh3e.s -isa=sh-dsp-up ERROR +sh3e.s -isa=sh ERROR +sh3e.s -isa=sh-up sh3e +sh3e.s -isa=sh2 ERROR +sh3e.s -isa=sh2-up sh3e +sh3e.s -isa=sh2e ERROR +sh3e.s -isa=sh2e-up sh3e +sh3e.s -isa=sh3-dsp ERROR +sh3e.s -isa=sh3-dsp-up ERROR +sh3e.s -isa=sh3-nommu ERROR +sh3e.s -isa=sh3-nommu-up sh3e +sh3e.s -isa=sh3 ERROR +sh3e.s -isa=sh3-up sh3e +sh3e.s -isa=sh3e sh3e +sh3e.s -isa=sh3e-up sh3e +sh3e.s -isa=sh4-nofpu ERROR +sh3e.s -isa=sh4-nofpu-up sh4 +sh3e.s -isa=sh4-nommu-nofpu ERROR +sh3e.s -isa=sh4-nommu-nofpu-up sh4 +sh3e.s -isa=sh4 sh4 +sh3e.s -isa=sh4-up sh4 +sh3e.s -isa=sh4a-nofpu ERROR +sh3e.s -isa=sh4a-nofpu-up sh4a +sh3e.s -isa=sh4a sh4a +sh3e.s -isa=sh4a-up sh4a +sh3e.s -isa=sh4al-dsp ERROR +sh3e.s -isa=sh4al-dsp-up ERROR +sh4-nofpu.s default-options sh4-nofpu +sh4-nofpu.s -dsp sh4-nofpu +sh4-nofpu.s -isa=any sh4-nofpu +sh4-nofpu.s -isa=dsp sh4-nofpu +sh4-nofpu.s -isa=fp sh4-nofpu +sh4-nofpu.s -isa=sh-dsp ERROR +sh4-nofpu.s -isa=sh-dsp-up sh4al-dsp +sh4-nofpu.s -isa=sh ERROR +sh4-nofpu.s -isa=sh-up sh4-nofpu +sh4-nofpu.s -isa=sh2 ERROR +sh4-nofpu.s -isa=sh2-up sh4-nofpu +sh4-nofpu.s -isa=sh2e ERROR +sh4-nofpu.s -isa=sh2e-up sh4 +sh4-nofpu.s -isa=sh3-dsp ERROR +sh4-nofpu.s -isa=sh3-dsp-up sh4al-dsp +sh4-nofpu.s -isa=sh3-nommu ERROR +sh4-nofpu.s -isa=sh3-nommu-up sh4-nofpu +sh4-nofpu.s -isa=sh3 ERROR +sh4-nofpu.s -isa=sh3-up sh4-nofpu +sh4-nofpu.s -isa=sh3e ERROR +sh4-nofpu.s -isa=sh3e-up sh4 +sh4-nofpu.s -isa=sh4-nofpu sh4-nofpu +sh4-nofpu.s -isa=sh4-nofpu-up sh4-nofpu +sh4-nofpu.s -isa=sh4-nommu-nofpu ERROR +sh4-nofpu.s -isa=sh4-nommu-nofpu-up sh4-nofpu +sh4-nofpu.s -isa=sh4 sh4 +sh4-nofpu.s -isa=sh4-up sh4 +sh4-nofpu.s -isa=sh4a-nofpu sh4a-nofpu +sh4-nofpu.s -isa=sh4a-nofpu-up sh4a-nofpu +sh4-nofpu.s -isa=sh4a sh4a +sh4-nofpu.s -isa=sh4a-up sh4a +sh4-nofpu.s -isa=sh4al-dsp sh4al-dsp +sh4-nofpu.s -isa=sh4al-dsp-up sh4al-dsp +sh4-nommu-nofpu.s default-options sh4-nommu-nofpu +sh4-nommu-nofpu.s -dsp sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=any sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=dsp sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=fp sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=sh-dsp ERROR +sh4-nommu-nofpu.s -isa=sh-dsp-up sh4al-dsp +sh4-nommu-nofpu.s -isa=sh ERROR +sh4-nommu-nofpu.s -isa=sh-up sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=sh2 ERROR +sh4-nommu-nofpu.s -isa=sh2-up sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=sh2e ERROR +sh4-nommu-nofpu.s -isa=sh2e-up sh4 +sh4-nommu-nofpu.s -isa=sh3-dsp ERROR +sh4-nommu-nofpu.s -isa=sh3-dsp-up sh4al-dsp +sh4-nommu-nofpu.s -isa=sh3-nommu ERROR +sh4-nommu-nofpu.s -isa=sh3-nommu-up sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=sh3 ERROR +sh4-nommu-nofpu.s -isa=sh3-up sh4-nofpu +sh4-nommu-nofpu.s -isa=sh3e ERROR +sh4-nommu-nofpu.s -isa=sh3e-up sh4 +sh4-nommu-nofpu.s -isa=sh4-nofpu sh4-nofpu +sh4-nommu-nofpu.s -isa=sh4-nofpu-up sh4-nofpu +sh4-nommu-nofpu.s -isa=sh4-nommu-nofpu sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=sh4-nommu-nofpu-up sh4-nommu-nofpu +sh4-nommu-nofpu.s -isa=sh4 sh4 +sh4-nommu-nofpu.s -isa=sh4-up sh4 +sh4-nommu-nofpu.s -isa=sh4a-nofpu sh4a-nofpu +sh4-nommu-nofpu.s -isa=sh4a-nofpu-up sh4a-nofpu +sh4-nommu-nofpu.s -isa=sh4a sh4a +sh4-nommu-nofpu.s -isa=sh4a-up sh4a +sh4-nommu-nofpu.s -isa=sh4al-dsp sh4al-dsp +sh4-nommu-nofpu.s -isa=sh4al-dsp-up sh4al-dsp +sh4.s default-options sh4 +sh4.s -dsp ERROR +sh4.s -isa=any sh4 +sh4.s -isa=dsp ERROR +sh4.s -isa=fp sh4 +sh4.s -isa=sh-dsp ERROR +sh4.s -isa=sh-dsp-up ERROR +sh4.s -isa=sh ERROR +sh4.s -isa=sh-up sh4 +sh4.s -isa=sh2 ERROR +sh4.s -isa=sh2-up sh4 +sh4.s -isa=sh2e ERROR +sh4.s -isa=sh2e-up sh4 +sh4.s -isa=sh3-dsp ERROR +sh4.s -isa=sh3-dsp-up ERROR +sh4.s -isa=sh3-nommu ERROR +sh4.s -isa=sh3-nommu-up sh4 +sh4.s -isa=sh3 ERROR +sh4.s -isa=sh3-up sh4 +sh4.s -isa=sh3e ERROR +sh4.s -isa=sh3e-up sh4 +sh4.s -isa=sh4-nofpu ERROR +sh4.s -isa=sh4-nofpu-up sh4 +sh4.s -isa=sh4-nommu-nofpu ERROR +sh4.s -isa=sh4-nommu-nofpu-up sh4 +sh4.s -isa=sh4 sh4 +sh4.s -isa=sh4-up sh4 +sh4.s -isa=sh4a-nofpu ERROR +sh4.s -isa=sh4a-nofpu-up sh4a +sh4.s -isa=sh4a sh4a +sh4.s -isa=sh4a-up sh4a +sh4.s -isa=sh4al-dsp ERROR +sh4.s -isa=sh4al-dsp-up ERROR +sh4a-nofpu.s default-options sh4a-nofpu +sh4a-nofpu.s -dsp sh4a-nofpu +sh4a-nofpu.s -isa=any sh4a-nofpu +sh4a-nofpu.s -isa=dsp sh4a-nofpu +sh4a-nofpu.s -isa=fp sh4a-nofpu +sh4a-nofpu.s -isa=sh-dsp ERROR +sh4a-nofpu.s -isa=sh-dsp-up sh4al-dsp +sh4a-nofpu.s -isa=sh ERROR +sh4a-nofpu.s -isa=sh-up sh4a-nofpu +sh4a-nofpu.s -isa=sh2 ERROR +sh4a-nofpu.s -isa=sh2-up sh4a-nofpu +sh4a-nofpu.s -isa=sh2e ERROR +sh4a-nofpu.s -isa=sh2e-up sh4a +sh4a-nofpu.s -isa=sh3-dsp ERROR +sh4a-nofpu.s -isa=sh3-dsp-up sh4al-dsp +sh4a-nofpu.s -isa=sh3-nommu ERROR +sh4a-nofpu.s -isa=sh3-nommu-up sh4a-nofpu +sh4a-nofpu.s -isa=sh3 ERROR +sh4a-nofpu.s -isa=sh3-up sh4a-nofpu +sh4a-nofpu.s -isa=sh3e ERROR +sh4a-nofpu.s -isa=sh3e-up sh4a +sh4a-nofpu.s -isa=sh4-nofpu ERROR +sh4a-nofpu.s -isa=sh4-nofpu-up sh4a-nofpu +sh4a-nofpu.s -isa=sh4-nommu-nofpu ERROR +sh4a-nofpu.s -isa=sh4-nommu-nofpu-up sh4a-nofpu +sh4a-nofpu.s -isa=sh4 ERROR +sh4a-nofpu.s -isa=sh4-up sh4a +sh4a-nofpu.s -isa=sh4a-nofpu sh4a-nofpu +sh4a-nofpu.s -isa=sh4a-nofpu-up sh4a-nofpu +sh4a-nofpu.s -isa=sh4a sh4a +sh4a-nofpu.s -isa=sh4a-up sh4a +sh4a-nofpu.s -isa=sh4al-dsp sh4al-dsp +sh4a-nofpu.s -isa=sh4al-dsp-up sh4al-dsp +sh4a.s default-options sh4a +sh4a.s -dsp ERROR +sh4a.s -isa=any sh4a +sh4a.s -isa=dsp ERROR +sh4a.s -isa=fp sh4a +sh4a.s -isa=sh-dsp ERROR +sh4a.s -isa=sh-dsp-up ERROR +sh4a.s -isa=sh ERROR +sh4a.s -isa=sh-up sh4a +sh4a.s -isa=sh2 ERROR +sh4a.s -isa=sh2-up sh4a +sh4a.s -isa=sh2e ERROR +sh4a.s -isa=sh2e-up sh4a +sh4a.s -isa=sh3-dsp ERROR +sh4a.s -isa=sh3-dsp-up ERROR +sh4a.s -isa=sh3-nommu ERROR +sh4a.s -isa=sh3-nommu-up sh4a +sh4a.s -isa=sh3 ERROR +sh4a.s -isa=sh3-up sh4a +sh4a.s -isa=sh3e ERROR +sh4a.s -isa=sh3e-up sh4a +sh4a.s -isa=sh4-nofpu ERROR +sh4a.s -isa=sh4-nofpu-up sh4a +sh4a.s -isa=sh4-nommu-nofpu ERROR +sh4a.s -isa=sh4-nommu-nofpu-up sh4a +sh4a.s -isa=sh4 ERROR +sh4a.s -isa=sh4-up sh4a +sh4a.s -isa=sh4a-nofpu ERROR +sh4a.s -isa=sh4a-nofpu-up sh4a +sh4a.s -isa=sh4a sh4a +sh4a.s -isa=sh4a-up sh4a +sh4a.s -isa=sh4al-dsp ERROR +sh4a.s -isa=sh4al-dsp-up ERROR +sh4al-dsp.s default-options ERROR +sh4al-dsp.s -dsp sh4al-dsp +sh4al-dsp.s -isa=any sh4al-dsp +sh4al-dsp.s -isa=dsp sh4al-dsp +sh4al-dsp.s -isa=fp ERROR +sh4al-dsp.s -isa=sh-dsp ERROR +sh4al-dsp.s -isa=sh-dsp-up sh4al-dsp +sh4al-dsp.s -isa=sh ERROR +sh4al-dsp.s -isa=sh-up sh4al-dsp +sh4al-dsp.s -isa=sh2 ERROR +sh4al-dsp.s -isa=sh2-up sh4al-dsp +sh4al-dsp.s -isa=sh2e ERROR +sh4al-dsp.s -isa=sh2e-up ERROR +sh4al-dsp.s -isa=sh3-dsp ERROR +sh4al-dsp.s -isa=sh3-dsp-up sh4al-dsp +sh4al-dsp.s -isa=sh3-nommu ERROR +sh4al-dsp.s -isa=sh3-nommu-up sh4al-dsp +sh4al-dsp.s -isa=sh3 ERROR +sh4al-dsp.s -isa=sh3-up sh4al-dsp +sh4al-dsp.s -isa=sh3e ERROR +sh4al-dsp.s -isa=sh3e-up ERROR +sh4al-dsp.s -isa=sh4-nofpu ERROR +sh4al-dsp.s -isa=sh4-nofpu-up sh4al-dsp +sh4al-dsp.s -isa=sh4-nommu-nofpu ERROR +sh4al-dsp.s -isa=sh4-nommu-nofpu-up sh4al-dsp +sh4al-dsp.s -isa=sh4 ERROR +sh4al-dsp.s -isa=sh4-up ERROR +sh4al-dsp.s -isa=sh4a-nofpu ERROR +sh4al-dsp.s -isa=sh4a-nofpu-up sh4al-dsp +sh4al-dsp.s -isa=sh4a ERROR +sh4al-dsp.s -isa=sh4a-up ERROR +sh4al-dsp.s -isa=sh4al-dsp sh4al-dsp +sh4al-dsp.s -isa=sh4al-dsp-up sh4al-dsp diff --git a/gas/testsuite/gas/sh/arch/sh-dsp.s b/gas/testsuite/gas/sh/arch/sh-dsp.s new file mode 100644 index 00000000000..fcfdbd3c016 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh-dsp.s @@ -0,0 +1,3 @@ + .section .text +sh2_dsp: + ldc r1,mod diff --git a/gas/testsuite/gas/sh/arch/sh.s b/gas/testsuite/gas/sh/arch/sh.s new file mode 100644 index 00000000000..22feb5f86dc --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh.s @@ -0,0 +1,3 @@ + .section .text +sh1: + mov r1,r2 diff --git a/gas/testsuite/gas/sh/arch/sh2.s b/gas/testsuite/gas/sh/arch/sh2.s new file mode 100644 index 00000000000..a1e2607437d --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh2.s @@ -0,0 +1,3 @@ + .section .text +sh2: + bt.s sh2 diff --git a/gas/testsuite/gas/sh/arch/sh2e.s b/gas/testsuite/gas/sh/arch/sh2e.s new file mode 100644 index 00000000000..207cee02922 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh2e.s @@ -0,0 +1,3 @@ + .section .text +sh2e: + lds r1,fpul diff --git a/gas/testsuite/gas/sh/arch/sh3-dsp.s b/gas/testsuite/gas/sh/arch/sh3-dsp.s new file mode 100644 index 00000000000..9dfcfeeb4e9 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh3-dsp.s @@ -0,0 +1,4 @@ + .section .text +sh3_dsp: + ldc r1,ssr + ldc r1,mod diff --git a/gas/testsuite/gas/sh/arch/sh3-nommu.s b/gas/testsuite/gas/sh/arch/sh3-nommu.s new file mode 100644 index 00000000000..5abfda92de9 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh3-nommu.s @@ -0,0 +1,3 @@ + .section .text +sh3_nommu: + ldc r1,ssr diff --git a/gas/testsuite/gas/sh/arch/sh3.s b/gas/testsuite/gas/sh/arch/sh3.s new file mode 100644 index 00000000000..de14a8fcca0 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh3.s @@ -0,0 +1,4 @@ + .section .text +sh3: + ldc r1,ssr + ldtlb diff --git a/gas/testsuite/gas/sh/arch/sh3e.s b/gas/testsuite/gas/sh/arch/sh3e.s new file mode 100644 index 00000000000..acb6ac84c8b --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh3e.s @@ -0,0 +1,3 @@ + .section .text +sh3e: + fsqrt fr1 diff --git a/gas/testsuite/gas/sh/arch/sh4-nofpu.s b/gas/testsuite/gas/sh/arch/sh4-nofpu.s new file mode 100644 index 00000000000..b8bdec1b02e --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh4-nofpu.s @@ -0,0 +1,4 @@ + .section .text +sh4_nofpu: + ldc r1,sgr + ldtlb diff --git a/gas/testsuite/gas/sh/arch/sh4-nommu-nofpu.s b/gas/testsuite/gas/sh/arch/sh4-nommu-nofpu.s new file mode 100644 index 00000000000..a6febe3fe59 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh4-nommu-nofpu.s @@ -0,0 +1,3 @@ + .section .text +sh4_nommu_nofpu: + ldc r1,sgr diff --git a/gas/testsuite/gas/sh/arch/sh4.s b/gas/testsuite/gas/sh/arch/sh4.s new file mode 100644 index 00000000000..13e633d08d6 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh4.s @@ -0,0 +1,3 @@ + .section .text +sh4: + fabs dr0 diff --git a/gas/testsuite/gas/sh/arch/sh4a-nofpu.s b/gas/testsuite/gas/sh/arch/sh4a-nofpu.s new file mode 100644 index 00000000000..e5058c7a008 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh4a-nofpu.s @@ -0,0 +1,3 @@ + .section .text +sh4a_nofpu: + icbi @r1 diff --git a/gas/testsuite/gas/sh/arch/sh4a.s b/gas/testsuite/gas/sh/arch/sh4a.s new file mode 100644 index 00000000000..ff969922317 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh4a.s @@ -0,0 +1,3 @@ + .section .text +sh4a: + fpchg diff --git a/gas/testsuite/gas/sh/arch/sh4al-dsp.s b/gas/testsuite/gas/sh/arch/sh4al-dsp.s new file mode 100644 index 00000000000..8ff6a8b5e59 --- /dev/null +++ b/gas/testsuite/gas/sh/arch/sh4al-dsp.s @@ -0,0 +1,3 @@ + .section .text +sh4al_dsp: + clrdmxy diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 979d491c6f7..e129ab527f7 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,24 @@ +2004-06-29 J"orn Rennecke + + Actually add these files: + 2004-05-28 Andrew Stubbs + * testsuite/ld-sh/arch/arch.exp: New test script. + * testsuite/ld-sh/arch/arch_expected.txt: New file. + * testsuite/ld-sh/arch/sh.s: New file. + * testsuite/ld-sh/arch/sh2.s: New file. + * testsuite/ld-sh/arch/sh-dsp.s: New file. + * testsuite/ld-sh/arch/sh2e.s: New file. + * testsuite/ld-sh/arch/sh3-nommu.s: New file. + * testsuite/ld-sh/arch/sh3.s: New file. + * testsuite/ld-sh/arch/sh3-dsp.s: New file. + * testsuite/ld-sh/arch/sh3e.s: New file. + * testsuite/ld-sh/arch/sh4-nommu-nofpu.s: New file. + * testsuite/ld-sh/arch/sh4-nofpu.s: New file. + * testsuite/ld-sh/arch/sh4.s: New file. + * testsuite/ld-sh/arch/sh4a-nofpu.s: New file. + * testsuite/ld-sh/arch/sh4al-dsp.s: New file. + * testsuite/ld-sh/arch/sh4a.s: New file. + 2004-06-29 Alan Modra * ld-elf/frame.exp: Don't run on mcore. diff --git a/ld/testsuite/ld-sh/arch/arch.exp b/ld/testsuite/ld-sh/arch/arch.exp new file mode 100644 index 00000000000..94120a26cc7 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/arch.exp @@ -0,0 +1,244 @@ +# Copyright (C) 2004 +# Free Software Foundation, Inc. + +# 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# dejagnu@gnu.org + +# This scripts tests of all available SH architectures with all other SH +# architectures. It ensures that those combinations which should not work +# do not work, and that those that should work produce the correct output +# architecture. +# +# It looks for files in the same directory as this file named sh*.s . +# Each file must contain one or more instructions which uniquely identifies +# that architecture. The architecture name is inferred from the file name. +# +# It also creates another architecture named 'sh-unknown' by modifying +# another arch type (there is no way to assemble such an arch) in order +# to test what the linker would do with an older object file. +# +# The script generates the architecture permutations automatically, +# but it reads the expected results from the file arch_expected.txt (also +# found in the same directory as this script). +# +# The arch_expected.txt file should NOT be hand edited. Whenever the script +# is run (e.g. with 'make check') it creates a new (usually identical) file +# named arch_results.txt in the /ld/testsuite directory. When the +# expected results change (or new architectures are added) this new file +# can be used to replace arch_expected.txt with no modification required. + + +# The procedure extracts the architecture name from the objdump output. +# If there is no architecture name (or objdump output changes significantly) +# then the behaviour is undefined, but it will most likely return junk. + +proc get_sh_arch { ofile } { + global OBJDUMP + + set cmd "$OBJDUMP -f $ofile" + verbose -log $cmd + catch "exec $cmd" objdump_output + verbose -log $objdump_output + + set objdump_output [string replace $objdump_output 0 \ + [expr [string first "architecture:" $objdump_output] + 13] ""] + + return [string range $objdump_output 0 [expr [string first "," $objdump_output] - 1]] +} + + +# This procedure runs two tests: +# Test 1: Check the linker can link the given files. +# Test 2: Check that the resultant architecture is as expected. +# It also writes an entry to the arch_results.txt file. + +proc test_arch { file1 file2 arch resultfile } { + global LD + + set name1 [file tail $file1] + set rootname1 [file rootname $name1] + + set name2 [file tail $file2] + set rootname2 [file rootname $name2] + + set result [default_ld_simple_link $LD "${rootname1}_${rootname2}.o" "$file1 $file2"] + + if {$result == 1} then { + pass "$rootname1 file should link with $rootname2 file" + + set result [get_sh_arch "${rootname1}_${rootname2}.o"] + puts $resultfile [format "%-20s %-20s %s" $file1 $file2 $result] + + if {$result == $arch} then { + pass "$rootname1 file with $rootname2 file should link to arch $arch" + file delete "${rootname1}_${rootname2}.o" + } else { + fail "$rootname1 file with $rootname2 file should link to arch $arch" + } + } else { + fail "$rootname1 file should link with $rootname2 file" + + puts $resultfile [format "%-20s %-20s ERROR" $file1 $file2] + untested "$rootname2 file with $rootname2 file should link to arch $arch" + } + +} + + + +# This procedure tests that a pair of files that are not +# suposed to link does, in fact, not link. +# It also writes an entry to the arch_results.txt file. + +proc test_arch_error { file1 file2 resultfile} { + global link_output LD + + set name1 [file tail $file1] + set rootname1 [file rootname $name1] + + set name2 [file tail $file2] + set rootname2 [file rootname $name2] + + set result [default_ld_simple_link $LD "${rootname1}_${rootname2}.o" "$file1 $file2"] + + if {$result == 1} then { + fail "$rootname1 file should NOT link with $rootname2 file" + puts $resultfile [format "%-20s %-20s [get_sh_arch ${rootname1}_${rootname2}.o]" $file1 $file2] + } else { + pass "$rootname1 file should NOT link with $rootname2 file" + puts $resultfile [format "%-20s %-20s ERROR" $file1 $file2] + } +} + +# These tests are not suitable for sh-coff because +# coff does not store the architecture information. + +if [istarget sh*-*-elf] then { + global subdir srcdir + global AS + + # Find all the architectures and assemble all the files + # we will use for the linker tests. + + set sfilelist [lsort -ascii [glob "$srcdir/$subdir/sh*.s"]] + set ofilelist {} + foreach sfile $sfilelist { + set ofile "[file rootname [file tail $sfile]].o" + lappend ofilelist $ofile + + set endian "-big" + if [string equal [big_or_little_endian] " -EL"] then { + set endian "-little" + } + + set cmd "$AS $endian -isa=any $sfile -o $ofile" + verbose -log $cmd + catch "exec $cmd" as_output + if ![file exists $ofile] then { + verbose -log $as_output + perror "$sfile: assembly failed" + } + } + + # Create the default arch ofile + # This cannot be created with the assembler + # sh4al-dsp is number 6, sh-unknown is 0 + + lappend ofilelist "sh-unknown.o" + + if [string equal [big_or_little_endian] " -EL"] then { + set cmd {xxd sh4al-dsp.o | sed {s/\(^0000020: .... .... \)06/\100/} | xxd -r - sh-unknown.o} + } else { + set cmd {xxd sh4al-dsp.o | sed {s/\(^0000020: .... .... .... ..\)06/\100/} | xxd -r - sh-unknown.o} + } + verbose -log $cmd + catch "exec $cmd" xxd_output + verbose -log $xxd_output + if [string equal [get_sh_arch "sh-unknown.o"] "sh4al-dsp"] then { + perror "sh-unknown.o not generated correctly" + } + + + # Initialise the results file + + set outfile [open "arch_results.txt" w 0666] + puts $outfile "# Generated file. DO NOT EDIT" + puts $outfile "#" + puts $outfile "# This file is generated by ld/testsuite/ld-sh/arch/arch.exp ." + puts $outfile "# It contains the expected results of the tests." + puts $outfile "# If the tests are failing because the expected results" + puts $outfile "# have changed then run 'make check' and copy the new file" + puts $outfile "# from /ld/arch_results.txt" + puts $outfile "# to /ld/testsuite/ld-sh/arch/arch_expected.txt ." + puts $outfile "# Make sure the new expected results are ALL correct." + puts $outfile "#" + puts $outfile [format "# %-18s %-20s %s" "FILE1" "FILE2" "OUTPUT"] + puts $outfile [format "# %-18s %-20s %s" "-----" "-----" "------"] + + # Open the expected results file and skip the header + + set infile [open "$srcdir/$subdir/arch_expected.txt" r] + while {[gets $infile line] >= 0 && [string match {\#*} $line]} {verbose -log "reading '$line'"} + + foreach file1 $ofilelist { + foreach file2 $ofilelist { + set name1 [file tail $file1] + set rootname1 [file rootname $name1] + + set name2 [file tail $file2] + set rootname2 [file rootname $name2] + + # Decode the expected result from the file + + scan $line "%s %s %s" exfile1 exfile2 exarch + verbose -log "exfile1 = '$exfile1', exfile2 = '$exfile2', exarch = '$exarch'" + verbose -log " name1 = '$name1', name2 = '$name2'" + + if {[string equal $exfile1 $name1] && [string equal $exfile2 $file2]} then { + # The expected result file makes sense and + # appears up-to-date (the file and options match) + + if {[string equal $exarch "ERROR"]} then { + test_arch_error $file1 $file2 $outfile + } else { + test_arch $file1 $file2 $exarch $outfile + } + } else { + # The expected result file isn't right somehow + # so just try any old test. This will cause + # many failures, but will genrate the results file. + + test_arch $file1 $file2 $rootname1 $outfile + } + + # Read the next line from the expected result file. + # This is at the end because the process of skipping + # the header reads the first real line + + if [gets $infile line] then { + verbose -log "reading '$line'" + } + } + } + + close $infile + close $outfile + + foreach file $ofilelist { + file delete $file + } +} diff --git a/ld/testsuite/ld-sh/arch/arch_expected.txt b/ld/testsuite/ld-sh/arch/arch_expected.txt new file mode 100644 index 00000000000..60e93389f73 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/arch_expected.txt @@ -0,0 +1,237 @@ +# Generated file. DO NOT EDIT +# +# This file is generated by ld/testsuite/ld-sh/arch/arch.exp . +# It contains the expected results of the tests. +# If the tests are failing because the expected results +# have changed then run 'make check' and copy the new file +# from /ld/testsuite/arch_results.txt +# to /ld/testsuite/ld-sh/arch/arch_expected.txt . +# Make sure the new expected results are ALL correct. +# +# FILE1 FILE2 OUTPUT +# ----- ----- ------ +sh-dsp.o sh-dsp.o sh-dsp +sh-dsp.o sh.o sh-dsp +sh-dsp.o sh2.o sh-dsp +sh-dsp.o sh2e.o ERROR +sh-dsp.o sh3-dsp.o sh3-dsp +sh-dsp.o sh3-nommu.o sh3-dsp +sh-dsp.o sh3.o sh3-dsp +sh-dsp.o sh3e.o ERROR +sh-dsp.o sh4-nofpu.o sh4al-dsp +sh-dsp.o sh4-nommu-nofpu.o sh4al-dsp +sh-dsp.o sh4.o ERROR +sh-dsp.o sh4a-nofpu.o sh4al-dsp +sh-dsp.o sh4a.o ERROR +sh-dsp.o sh4al-dsp.o sh4al-dsp +sh-dsp.o sh-unknown.o sh3-dsp +sh.o sh-dsp.o sh-dsp +sh.o sh.o sh +sh.o sh2.o sh2 +sh.o sh2e.o sh2e +sh.o sh3-dsp.o sh3-dsp +sh.o sh3-nommu.o sh3-nommu +sh.o sh3.o sh3 +sh.o sh3e.o sh3e +sh.o sh4-nofpu.o sh4-nofpu +sh.o sh4-nommu-nofpu.o sh4-nommu-nofpu +sh.o sh4.o sh4 +sh.o sh4a-nofpu.o sh4a-nofpu +sh.o sh4a.o sh4a +sh.o sh4al-dsp.o sh4al-dsp +sh.o sh-unknown.o sh3 +sh2.o sh-dsp.o sh-dsp +sh2.o sh.o sh2 +sh2.o sh2.o sh2 +sh2.o sh2e.o sh2e +sh2.o sh3-dsp.o sh3-dsp +sh2.o sh3-nommu.o sh3-nommu +sh2.o sh3.o sh3 +sh2.o sh3e.o sh3e +sh2.o sh4-nofpu.o sh4-nofpu +sh2.o sh4-nommu-nofpu.o sh4-nommu-nofpu +sh2.o sh4.o sh4 +sh2.o sh4a-nofpu.o sh4a-nofpu +sh2.o sh4a.o sh4a +sh2.o sh4al-dsp.o sh4al-dsp +sh2.o sh-unknown.o sh3 +sh2e.o sh-dsp.o ERROR +sh2e.o sh.o sh2e +sh2e.o sh2.o sh2e +sh2e.o sh2e.o sh2e +sh2e.o sh3-dsp.o ERROR +sh2e.o sh3-nommu.o sh3e +sh2e.o sh3.o sh3e +sh2e.o sh3e.o sh3e +sh2e.o sh4-nofpu.o sh4 +sh2e.o sh4-nommu-nofpu.o sh4 +sh2e.o sh4.o sh4 +sh2e.o sh4a-nofpu.o sh4a +sh2e.o sh4a.o sh4a +sh2e.o sh4al-dsp.o ERROR +sh2e.o sh-unknown.o sh3e +sh3-dsp.o sh-dsp.o sh3-dsp +sh3-dsp.o sh.o sh3-dsp +sh3-dsp.o sh2.o sh3-dsp +sh3-dsp.o sh2e.o ERROR +sh3-dsp.o sh3-dsp.o sh3-dsp +sh3-dsp.o sh3-nommu.o sh3-dsp +sh3-dsp.o sh3.o sh3-dsp +sh3-dsp.o sh3e.o ERROR +sh3-dsp.o sh4-nofpu.o sh4al-dsp +sh3-dsp.o sh4-nommu-nofpu.o sh4al-dsp +sh3-dsp.o sh4.o ERROR +sh3-dsp.o sh4a-nofpu.o sh4al-dsp +sh3-dsp.o sh4a.o ERROR +sh3-dsp.o sh4al-dsp.o sh4al-dsp +sh3-dsp.o sh-unknown.o sh3-dsp +sh3-nommu.o sh-dsp.o sh3-dsp +sh3-nommu.o sh.o sh3-nommu +sh3-nommu.o sh2.o sh3-nommu +sh3-nommu.o sh2e.o sh3e +sh3-nommu.o sh3-dsp.o sh3-dsp +sh3-nommu.o sh3-nommu.o sh3-nommu +sh3-nommu.o sh3.o sh3 +sh3-nommu.o sh3e.o sh3e +sh3-nommu.o sh4-nofpu.o sh4-nofpu +sh3-nommu.o sh4-nommu-nofpu.o sh4-nommu-nofpu +sh3-nommu.o sh4.o sh4 +sh3-nommu.o sh4a-nofpu.o sh4a-nofpu +sh3-nommu.o sh4a.o sh4a +sh3-nommu.o sh4al-dsp.o sh4al-dsp +sh3-nommu.o sh-unknown.o sh3 +sh3.o sh-dsp.o sh3-dsp +sh3.o sh.o sh3 +sh3.o sh2.o sh3 +sh3.o sh2e.o sh3e +sh3.o sh3-dsp.o sh3-dsp +sh3.o sh3-nommu.o sh3 +sh3.o sh3.o sh3 +sh3.o sh3e.o sh3e +sh3.o sh4-nofpu.o sh4-nofpu +sh3.o sh4-nommu-nofpu.o sh4-nofpu +sh3.o sh4.o sh4 +sh3.o sh4a-nofpu.o sh4a-nofpu +sh3.o sh4a.o sh4a +sh3.o sh4al-dsp.o sh4al-dsp +sh3.o sh-unknown.o sh3 +sh3e.o sh-dsp.o ERROR +sh3e.o sh.o sh3e +sh3e.o sh2.o sh3e +sh3e.o sh2e.o sh3e +sh3e.o sh3-dsp.o ERROR +sh3e.o sh3-nommu.o sh3e +sh3e.o sh3.o sh3e +sh3e.o sh3e.o sh3e +sh3e.o sh4-nofpu.o sh4 +sh3e.o sh4-nommu-nofpu.o sh4 +sh3e.o sh4.o sh4 +sh3e.o sh4a-nofpu.o sh4a +sh3e.o sh4a.o sh4a +sh3e.o sh4al-dsp.o ERROR +sh3e.o sh-unknown.o sh3e +sh4-nofpu.o sh-dsp.o sh4al-dsp +sh4-nofpu.o sh.o sh4-nofpu +sh4-nofpu.o sh2.o sh4-nofpu +sh4-nofpu.o sh2e.o sh4 +sh4-nofpu.o sh3-dsp.o sh4al-dsp +sh4-nofpu.o sh3-nommu.o sh4-nofpu +sh4-nofpu.o sh3.o sh4-nofpu +sh4-nofpu.o sh3e.o sh4 +sh4-nofpu.o sh4-nofpu.o sh4-nofpu +sh4-nofpu.o sh4-nommu-nofpu.o sh4-nofpu +sh4-nofpu.o sh4.o sh4 +sh4-nofpu.o sh4a-nofpu.o sh4a-nofpu +sh4-nofpu.o sh4a.o sh4a +sh4-nofpu.o sh4al-dsp.o sh4al-dsp +sh4-nofpu.o sh-unknown.o sh4-nofpu +sh4-nommu-nofpu.o sh-dsp.o sh4al-dsp +sh4-nommu-nofpu.o sh.o sh4-nommu-nofpu +sh4-nommu-nofpu.o sh2.o sh4-nommu-nofpu +sh4-nommu-nofpu.o sh2e.o sh4 +sh4-nommu-nofpu.o sh3-dsp.o sh4al-dsp +sh4-nommu-nofpu.o sh3-nommu.o sh4-nommu-nofpu +sh4-nommu-nofpu.o sh3.o sh4-nofpu +sh4-nommu-nofpu.o sh3e.o sh4 +sh4-nommu-nofpu.o sh4-nofpu.o sh4-nofpu +sh4-nommu-nofpu.o sh4-nommu-nofpu.o sh4-nommu-nofpu +sh4-nommu-nofpu.o sh4.o sh4 +sh4-nommu-nofpu.o sh4a-nofpu.o sh4a-nofpu +sh4-nommu-nofpu.o sh4a.o sh4a +sh4-nommu-nofpu.o sh4al-dsp.o sh4al-dsp +sh4-nommu-nofpu.o sh-unknown.o sh4-nofpu +sh4.o sh-dsp.o ERROR +sh4.o sh.o sh4 +sh4.o sh2.o sh4 +sh4.o sh2e.o sh4 +sh4.o sh3-dsp.o ERROR +sh4.o sh3-nommu.o sh4 +sh4.o sh3.o sh4 +sh4.o sh3e.o sh4 +sh4.o sh4-nofpu.o sh4 +sh4.o sh4-nommu-nofpu.o sh4 +sh4.o sh4.o sh4 +sh4.o sh4a-nofpu.o sh4a +sh4.o sh4a.o sh4a +sh4.o sh4al-dsp.o ERROR +sh4.o sh-unknown.o sh4 +sh4a-nofpu.o sh-dsp.o sh4al-dsp +sh4a-nofpu.o sh.o sh4a-nofpu +sh4a-nofpu.o sh2.o sh4a-nofpu +sh4a-nofpu.o sh2e.o sh4a +sh4a-nofpu.o sh3-dsp.o sh4al-dsp +sh4a-nofpu.o sh3-nommu.o sh4a-nofpu +sh4a-nofpu.o sh3.o sh4a-nofpu +sh4a-nofpu.o sh3e.o sh4a +sh4a-nofpu.o sh4-nofpu.o sh4a-nofpu +sh4a-nofpu.o sh4-nommu-nofpu.o sh4a-nofpu +sh4a-nofpu.o sh4.o sh4a +sh4a-nofpu.o sh4a-nofpu.o sh4a-nofpu +sh4a-nofpu.o sh4a.o sh4a +sh4a-nofpu.o sh4al-dsp.o sh4al-dsp +sh4a-nofpu.o sh-unknown.o sh4a-nofpu +sh4a.o sh-dsp.o ERROR +sh4a.o sh.o sh4a +sh4a.o sh2.o sh4a +sh4a.o sh2e.o sh4a +sh4a.o sh3-dsp.o ERROR +sh4a.o sh3-nommu.o sh4a +sh4a.o sh3.o sh4a +sh4a.o sh3e.o sh4a +sh4a.o sh4-nofpu.o sh4a +sh4a.o sh4-nommu-nofpu.o sh4a +sh4a.o sh4.o sh4a +sh4a.o sh4a-nofpu.o sh4a +sh4a.o sh4a.o sh4a +sh4a.o sh4al-dsp.o ERROR +sh4a.o sh-unknown.o sh4a +sh4al-dsp.o sh-dsp.o sh4al-dsp +sh4al-dsp.o sh.o sh4al-dsp +sh4al-dsp.o sh2.o sh4al-dsp +sh4al-dsp.o sh2e.o ERROR +sh4al-dsp.o sh3-dsp.o sh4al-dsp +sh4al-dsp.o sh3-nommu.o sh4al-dsp +sh4al-dsp.o sh3.o sh4al-dsp +sh4al-dsp.o sh3e.o ERROR +sh4al-dsp.o sh4-nofpu.o sh4al-dsp +sh4al-dsp.o sh4-nommu-nofpu.o sh4al-dsp +sh4al-dsp.o sh4.o ERROR +sh4al-dsp.o sh4a-nofpu.o sh4al-dsp +sh4al-dsp.o sh4a.o ERROR +sh4al-dsp.o sh4al-dsp.o sh4al-dsp +sh4al-dsp.o sh-unknown.o sh4al-dsp +sh-unknown.o sh-dsp.o sh3-dsp +sh-unknown.o sh.o sh3 +sh-unknown.o sh2.o sh3 +sh-unknown.o sh2e.o sh3e +sh-unknown.o sh3-dsp.o sh3-dsp +sh-unknown.o sh3-nommu.o sh3 +sh-unknown.o sh3.o sh3 +sh-unknown.o sh3e.o sh3e +sh-unknown.o sh4-nofpu.o sh4-nofpu +sh-unknown.o sh4-nommu-nofpu.o sh4-nofpu +sh-unknown.o sh4.o sh4 +sh-unknown.o sh4a-nofpu.o sh4a-nofpu +sh-unknown.o sh4a.o sh4a +sh-unknown.o sh4al-dsp.o sh4al-dsp +sh-unknown.o sh-unknown.o sh3 diff --git a/ld/testsuite/ld-sh/arch/sh-dsp.s b/ld/testsuite/ld-sh/arch/sh-dsp.s new file mode 100644 index 00000000000..fcfdbd3c016 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh-dsp.s @@ -0,0 +1,3 @@ + .section .text +sh2_dsp: + ldc r1,mod diff --git a/ld/testsuite/ld-sh/arch/sh.s b/ld/testsuite/ld-sh/arch/sh.s new file mode 100644 index 00000000000..22feb5f86dc --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh.s @@ -0,0 +1,3 @@ + .section .text +sh1: + mov r1,r2 diff --git a/ld/testsuite/ld-sh/arch/sh2.s b/ld/testsuite/ld-sh/arch/sh2.s new file mode 100644 index 00000000000..a1e2607437d --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh2.s @@ -0,0 +1,3 @@ + .section .text +sh2: + bt.s sh2 diff --git a/ld/testsuite/ld-sh/arch/sh2e.s b/ld/testsuite/ld-sh/arch/sh2e.s new file mode 100644 index 00000000000..207cee02922 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh2e.s @@ -0,0 +1,3 @@ + .section .text +sh2e: + lds r1,fpul diff --git a/ld/testsuite/ld-sh/arch/sh3-dsp.s b/ld/testsuite/ld-sh/arch/sh3-dsp.s new file mode 100644 index 00000000000..9dfcfeeb4e9 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh3-dsp.s @@ -0,0 +1,4 @@ + .section .text +sh3_dsp: + ldc r1,ssr + ldc r1,mod diff --git a/ld/testsuite/ld-sh/arch/sh3-nommu.s b/ld/testsuite/ld-sh/arch/sh3-nommu.s new file mode 100644 index 00000000000..5abfda92de9 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh3-nommu.s @@ -0,0 +1,3 @@ + .section .text +sh3_nommu: + ldc r1,ssr diff --git a/ld/testsuite/ld-sh/arch/sh3.s b/ld/testsuite/ld-sh/arch/sh3.s new file mode 100644 index 00000000000..de14a8fcca0 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh3.s @@ -0,0 +1,4 @@ + .section .text +sh3: + ldc r1,ssr + ldtlb diff --git a/ld/testsuite/ld-sh/arch/sh3e.s b/ld/testsuite/ld-sh/arch/sh3e.s new file mode 100644 index 00000000000..acb6ac84c8b --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh3e.s @@ -0,0 +1,3 @@ + .section .text +sh3e: + fsqrt fr1 diff --git a/ld/testsuite/ld-sh/arch/sh4-nofpu.s b/ld/testsuite/ld-sh/arch/sh4-nofpu.s new file mode 100644 index 00000000000..b8bdec1b02e --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh4-nofpu.s @@ -0,0 +1,4 @@ + .section .text +sh4_nofpu: + ldc r1,sgr + ldtlb diff --git a/ld/testsuite/ld-sh/arch/sh4-nommu-nofpu.s b/ld/testsuite/ld-sh/arch/sh4-nommu-nofpu.s new file mode 100644 index 00000000000..a6febe3fe59 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh4-nommu-nofpu.s @@ -0,0 +1,3 @@ + .section .text +sh4_nommu_nofpu: + ldc r1,sgr diff --git a/ld/testsuite/ld-sh/arch/sh4.s b/ld/testsuite/ld-sh/arch/sh4.s new file mode 100644 index 00000000000..13e633d08d6 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh4.s @@ -0,0 +1,3 @@ + .section .text +sh4: + fabs dr0 diff --git a/ld/testsuite/ld-sh/arch/sh4a-nofpu.s b/ld/testsuite/ld-sh/arch/sh4a-nofpu.s new file mode 100644 index 00000000000..e5058c7a008 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh4a-nofpu.s @@ -0,0 +1,3 @@ + .section .text +sh4a_nofpu: + icbi @r1 diff --git a/ld/testsuite/ld-sh/arch/sh4a.s b/ld/testsuite/ld-sh/arch/sh4a.s new file mode 100644 index 00000000000..ff969922317 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh4a.s @@ -0,0 +1,3 @@ + .section .text +sh4a: + fpchg diff --git a/ld/testsuite/ld-sh/arch/sh4al-dsp.s b/ld/testsuite/ld-sh/arch/sh4al-dsp.s new file mode 100644 index 00000000000..8ff6a8b5e59 --- /dev/null +++ b/ld/testsuite/ld-sh/arch/sh4al-dsp.s @@ -0,0 +1,3 @@ + .section .text +sh4al_dsp: + clrdmxy