run_dump_test replace PROG with DUMPPROG in gas and ld

To be compatible with the binutils version, that uses PROG for the
tool under test and DUMPPROG for the dump tool.

gas/
	* testsuite/gas/mips/aent-2.d,
	* testsuite/gas/mips/aent-mdebug-2.d,
	* testsuite/gas/mips/attr-gnu-4-0.d,
	* testsuite/gas/mips/attr-gnu-4-1.d,
	* testsuite/gas/mips/attr-gnu-4-2.d,
	* testsuite/gas/mips/attr-gnu-4-3.d,
	* testsuite/gas/mips/attr-gnu-4-5.d,
	* testsuite/gas/mips/attr-gnu-4-6.d,
	* testsuite/gas/mips/attr-gnu-4-7.d,
	* testsuite/gas/mips/attr-none-double.d,
	* testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d,
	* testsuite/gas/mips/attr-none-o32-fp64.d,
	* testsuite/gas/mips/attr-none-o32-fpxx.d,
	* testsuite/gas/mips/attr-none-single-float.d,
	* testsuite/gas/mips/attr-none-soft-float.d,
	* testsuite/gas/mips/elf-rel27.d,
	* testsuite/gas/mips/loc-swap-2.d,
	* testsuite/gas/mips/loc-swap-3.d,
	* testsuite/gas/mips/loc-swap.d,
	* testsuite/gas/mips/micromips@loc-swap-2.d,
	* testsuite/gas/mips/micromips@loc-swap.d,
	* testsuite/gas/mips/micromips@stabs-symbol-type.d,
	* testsuite/gas/mips/mips16-intermix.d,
	* testsuite/gas/mips/mips16@loc-swap-2.d,
	* testsuite/gas/mips/mips16@loc-swap.d,
	* testsuite/gas/mips/mips16@stabs-symbol-type.d,
	* testsuite/gas/mips/mips16e@loc-swap.d,
	* testsuite/gas/mips/no-odd-spreg.d,
	* testsuite/gas/mips/odd-spreg.d,
	* testsuite/gas/mips/r6-attr-none-double.d,
	* testsuite/gas/mips/stabs-symbol-type.d,
	* testsuite/lib/gas-defs.exp (run_dump_test): Replace PROG
	with DUMPPROG.
ld/
	* testsuite/lib/ld-lib.exp (run_dump_test): Replace PROG
	with DUMPPROG.
This commit is contained in:
Alan Modra 2018-09-13 18:55:30 +09:30
parent 4abd8e8de7
commit 99bcaeaf0f
35 changed files with 117 additions and 75 deletions

View File

@ -1,3 +1,39 @@
2018-09-15 Alan Modra <amodra@gmail.com>
* testsuite/gas/mips/aent-2.d,
* testsuite/gas/mips/aent-mdebug-2.d,
* testsuite/gas/mips/attr-gnu-4-0.d,
* testsuite/gas/mips/attr-gnu-4-1.d,
* testsuite/gas/mips/attr-gnu-4-2.d,
* testsuite/gas/mips/attr-gnu-4-3.d,
* testsuite/gas/mips/attr-gnu-4-5.d,
* testsuite/gas/mips/attr-gnu-4-6.d,
* testsuite/gas/mips/attr-gnu-4-7.d,
* testsuite/gas/mips/attr-none-double.d,
* testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d,
* testsuite/gas/mips/attr-none-o32-fp64.d,
* testsuite/gas/mips/attr-none-o32-fpxx.d,
* testsuite/gas/mips/attr-none-single-float.d,
* testsuite/gas/mips/attr-none-soft-float.d,
* testsuite/gas/mips/elf-rel27.d,
* testsuite/gas/mips/loc-swap-2.d,
* testsuite/gas/mips/loc-swap-3.d,
* testsuite/gas/mips/loc-swap.d,
* testsuite/gas/mips/micromips@loc-swap-2.d,
* testsuite/gas/mips/micromips@loc-swap.d,
* testsuite/gas/mips/micromips@stabs-symbol-type.d,
* testsuite/gas/mips/mips16-intermix.d,
* testsuite/gas/mips/mips16@loc-swap-2.d,
* testsuite/gas/mips/mips16@loc-swap.d,
* testsuite/gas/mips/mips16@stabs-symbol-type.d,
* testsuite/gas/mips/mips16e@loc-swap.d,
* testsuite/gas/mips/no-odd-spreg.d,
* testsuite/gas/mips/odd-spreg.d,
* testsuite/gas/mips/r6-attr-none-double.d,
* testsuite/gas/mips/stabs-symbol-type.d,
* testsuite/lib/gas-defs.exp (run_dump_test): Replace PROG
with DUMPPROG.
2018-09-15 Alan Modra <amodra@gmail.com>
* testsuite/gas/elf/symver.d,

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -s
#name: MIPS .aent directive 2
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -s
#name: MIPS .aent directive with ECOFF debug 2
#as: -32 -mdebug

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS gnu_attribute 4,0

View File

@ -1,5 +1,5 @@
#source: attr-gnu-4-1.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS gnu_attribute 4,1 (double precision)

View File

@ -1,6 +1,6 @@
#source: attr-gnu-4-2.s
#as: -msingle-float
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS gnu_attribute 4,2 (single precision)

View File

@ -1,6 +1,6 @@
#as: -msoft-float
#source: attr-gnu-4-3.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS gnu_attribute 4,3 (-msoft-float)

View File

@ -1,6 +1,6 @@
#as: -32 -mfpxx
#source: attr-gnu-4-5.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS gnu_attribute 4,5 (-mfpxx)

View File

@ -1,6 +1,6 @@
#as: -32
#source: attr-gnu-4-6.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS gnu_attribute 4,6 (-mfp64)

View File

@ -1,6 +1,6 @@
#as: -32
#source: attr-gnu-4-7.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS gnu_attribute 4,7 (-mfp64 -mno-odd-spreg)

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#source: empty.s
#readelf: -A
#name: MIPS infer fpabi (double-precision)

View File

@ -1,6 +1,6 @@
#as: -mfp64 -mno-odd-spreg -32
#source: empty.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS infer fpabi (O32 fp64 nooddspreg)

View File

@ -1,6 +1,6 @@
#as: -mfp64 -32
#source: empty.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS infer fpabi (O32 fp64)

View File

@ -1,6 +1,6 @@
#as: -mfpxx -32
#source: empty.s
#PROG: readelf
#DUMPPROG: readelf
#readelf: -A
#name: MIPS infer fpabi (O32 fpxx)

View File

@ -1,5 +1,5 @@
#as: -msingle-float
#PROG: readelf
#DUMPPROG: readelf
#source: empty.s
#readelf: -A
#name: MIPS infer fpabi (single-precision)

View File

@ -1,5 +1,5 @@
#as: -msoft-float
#PROG: readelf
#DUMPPROG: readelf
#source: empty.s
#readelf: -A
#name: MIPS infer fpabi (soft-precision)

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -Wr
#name: MIPS ELF reloc 27
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#name: MIPS DWARF-2 location information with branch swapping (2)
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#as: -32
#name: MIPS DWARF-2 location information with branch swapping (3)

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#name: MIPS DWARF-2 location information with branch swapping
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#name: MIPS DWARF-2 location information with branch swapping (2)
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#name: MIPS DWARF-2 location information with branch swapping
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -s
#name: MIPS .stab symbol type
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: nm
#DUMPPROG: nm
#as: -mips32r2 -32
#name: MIPS16 intermix

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#name: MIPS DWARF-2 location information with branch swapping (2)
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#name: MIPS DWARF-2 location information with branch swapping
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -s
#name: MIPS .stab symbol type
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -wl
#name: MIPS DWARF-2 location information with branch swapping
#as: -32

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#source: empty.s
#as: -32 -mno-odd-spreg
#readelf: -A

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#source: empty.s
#as: -32 -modd-spreg
#readelf: -A

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#source: empty.s
#readelf: -A
#name: MIPS infer fpabi (double-precision)

View File

@ -1,4 +1,4 @@
#PROG: readelf
#DUMPPROG: readelf
#readelf: -s
#name: MIPS .stab symbol type
#as: -32

View File

@ -365,7 +365,7 @@ proc run_dump_tests { testcases {extra_options {}} } {
# FLAGS, in addition to the .o file name. Note that they are run
# with LC_ALL=C in the environment to give consistent sorting
# of symbols. If no FLAGS are needed then use:
# PROG: [nm objdump readelf addr2line]
# DUMPPROG: [nm objdump readelf addr2line]
# instead.
# Note: for objdump, we automatically replaces the standard section
# names (.text, .data and .bss) by target ones if any (eg. rx-elf
@ -413,7 +413,7 @@ proc run_dump_tests { testcases {extra_options {}} } {
#
# error: REGEX
# An error with message matching REGEX must be emitted for the test
# to pass. The PROG, addr2line, nm, objdump, and readelf options
# to pass. The DUMPPROG, addr2line, nm, objdump, and readelf options
# have no meaning and need not supplied if this is present.
#
# warning: REGEX
@ -423,11 +423,11 @@ proc run_dump_tests { testcases {extra_options {}} } {
# warning_output: FILE
# FILE contains regexp lines to be matched against the diagnostic
# output of the assembler. This does not preclude the use of
# PROG, addr2line, nm, objdump, or readelf.
# DUMPPROG, addr2line, nm, objdump, or readelf.
#
# error_output: FILE
# Means the same as 'warning_output', but also indicates that the assembler
# is expected to exit unsuccessfully (therefore PROG, addr2line, nm,
# is expected to exit unsuccessfully (therefore DUMPPROG, addr2line, nm,
# objdump, and readelf have no meaning and should not be supplied).
#
# section-subst: no
@ -466,7 +466,7 @@ proc run_dump_test { name {extra_options {}} } {
set opts(nm) {}
set opts(readelf) {}
set opts(name) {}
set opts(PROG) {}
set opts(DUMPPROG) {}
set opts(source) {}
set opts(dump) {}
set opts(warning_output) {}
@ -535,18 +535,18 @@ proc run_dump_test { name {extra_options {}} } {
set opts(warning_output) $opts(error_output)
}
set program ""
set dumpprogram ""
# It's meaningless to require an output-testing method when we
# expect an error.
if { $opts(error) == "" && $opts(error_output) == "" } {
if {$opts(PROG) != ""} {
switch -- $opts(PROG) {
addr2line { set program addr2line }
objdump { set program objdump }
nm { set program nm }
readelf { set program readelf }
if {$opts(DUMPPROG) != ""} {
switch -- $opts(DUMPPROG) {
addr2line { set dumpprogram addr2line }
objdump { set dumpprogram objdump }
nm { set dumpprogram nm }
readelf { set dumpprogram readelf }
default {
perror "unrecognized program option $opts(PROG) in $file.d"
perror "unrecognized DUMPPROG option $opts(DUMPPROG) in $file.d"
unresolved $testname
return }
}
@ -554,17 +554,17 @@ proc run_dump_test { name {extra_options {}} } {
# Guess which program to run, by seeing which option was specified.
foreach p {objdump nm readelf addr2line} {
if {$opts($p) != ""} {
if {$program != ""} {
if {$dumpprogram != ""} {
perror "ambiguous dump program in $file.d"
unresolved $testname
return
} else {
set program $p
set dumpprogram $p
}
}
}
}
if { $program == "" && $opts(warning) == "" } {
if { $dumpprogram == "" && $opts(warning) == "" } {
perror "dump program unspecified in $file.d"
unresolved $testname
return
@ -670,7 +670,7 @@ proc run_dump_test { name {extra_options {}} } {
&& (($cmdret == 0) == ($opts(warning) != "")) } {
# We have the expected output from gas.
# Return if there's nothing more to do.
if { $opts(error) != "" || $program == "" } {
if { $opts(error) != "" || $dumpprogram == "" } {
pass $testname
return
}
@ -714,12 +714,12 @@ proc run_dump_test { name {extra_options {}} } {
}
}
if { $program == "" } {
if { $dumpprogram == "" } {
return
}
set progopts1 $opts($program)
eval set progopts \$[string toupper $program]FLAGS
eval set binary \$[string toupper $program]
set progopts1 $opts($dumpprogram)
eval set progopts \$[string toupper $dumpprogram]FLAGS
eval set binary \$[string toupper $dumpprogram]
if { ![is_remote host] && [which $binary] == 0 } {
untested $testname
@ -729,7 +729,7 @@ proc run_dump_test { name {extra_options {}} } {
# For objdump, automatically translate standard section names to the targets one,
# if they are different.
set sect_names [get_standard_section_names]
if { $sect_names != "" && $program == "objdump" && $opts(section-subst) == ""} {
if { $sect_names != "" && $dumpprogram == "objdump" && $opts(section-subst) == ""} {
regsub -- "-j \\.text" $progopts1 "-j [lindex $sect_names 0]" progopts1
regsub -- "-j \\.data" $progopts1 "-j [lindex $sect_names 1]" progopts1
regsub -- "-j \\.bss" $progopts1 "-j [lindex $sect_names 2]" progopts1
@ -751,7 +751,7 @@ proc run_dump_test { name {extra_options {}} } {
}
# Create the substition list only for objdump reference.
if { $sect_names != "" && $program == "objdump" } {
if { $sect_names != "" && $dumpprogram == "objdump" } {
# Some testcases use ".text" while others use "\.text".
set regexp_subst [list "\\\\?\\.text" [lindex $sect_names 0] \
"\\\\?\\.data" [lindex $sect_names 1] \

View File

@ -1,3 +1,8 @@
2018-09-15 Alan Modra <amodra@gmail.com>
* testsuite/lib/ld-lib.exp (run_dump_test): Replace PROG
with DUMPPROG.
2018-09-15 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/interleave-0.d,

View File

@ -502,7 +502,7 @@ proc ld_link_defsyms {} {
# result is analyzed by an analyzer program specified below (which
# may in turn *also* be objcopy).
#
# PROG: PROGRAM-NAME
# DUMPPROG: PROGRAM-NAME
# The name of the program to run to analyze the .o file produced
# by the assembler or the linker output. This can be omitted;
# run_dump_test will guess which program to run by seeing which of
@ -567,7 +567,7 @@ proc ld_link_defsyms {} {
#
# error: REGEX
# An error with message matching REGEX must be emitted for the test
# to pass. The PROG, readelf, objdump, and nm options have
# to pass. The DUMPPROG, readelf, objdump, and nm options have
# no meaning and need not be supplied if this is present. Multiple
# "error" directives append to the expected linker error message.
#
@ -648,7 +648,7 @@ proc run_dump_test { name {extra_options {}} } {
set opts(nm) {}
set opts(readelf) {}
set opts(name) {}
set opts(PROG) {}
set opts(DUMPPROG) {}
set opts(source) {}
set opts(dump) {}
set opts(error) {}
@ -815,35 +815,36 @@ proc run_dump_test { name {extra_options {}} } {
}
}
set program ""
set dumpprogram ""
# It's meaningless to require an output-testing method when we
# expect an error.
if { $opts(error) == "" && $opts(error_output) == "" } {
if {$opts(PROG) != ""} {
switch -- $opts(PROG) {
objdump { set program objdump }
nm { set program nm }
readelf { set program readelf }
default
{ perror "unrecognized program option $opts(PROG) in $file.d"
unresolved $testname
return }
if { $opts(DUMPPROG) != "" } {
switch -- $opts(DUMPPROG) {
objdump { set dumpprogram objdump }
nm { set dumpprogram nm }
readelf { set dumpprogram readelf }
default {
perror "unrecognized DUMPPROG option $opts(DUMPPROG) in $file.d"
unresolved $testname
return
}
}
} else {
# Guess which program to run, by seeing which option was specified.
foreach p {objdump nm readelf} {
if {$opts($p) != ""} {
if {$program != ""} {
if {$dumpprogram != ""} {
perror "ambiguous dump program in $file.d"
unresolved $testname
return
} else {
set program $p
set dumpprogram $p
}
}
}
}
if { $program == "" \
if { $dumpprogram == "" \
&& $opts(map) == "" \
&& $opts(warning) == "" \
&& $opts(warning_output) == "" \
@ -1056,7 +1057,7 @@ proc run_dump_test { name {extra_options {}} } {
|| (($check_ld(source) == "file") \
&& (![regexp_diff "tmpdir/ld.messages" "$srcdir/$subdir/$check_ld(file)"]))) } {
# We have the expected output from ld.
if { $check_ld(terminal) || $program == "" } {
if { $check_ld(terminal) || $dumpprogram == "" } {
pass $testname
return
}
@ -1076,7 +1077,7 @@ proc run_dump_test { name {extra_options {}} } {
pass "$testname (map file check)"
}
if { $program == "" } then {
if { $dumpprogram == "" } then {
return
}
}
@ -1090,9 +1091,9 @@ proc run_dump_test { name {extra_options {}} } {
return
}
set progopts1 $opts($program)
eval set progopts \$[string toupper $program]FLAGS
eval set binary \$[string toupper $program]
set progopts1 $opts($dumpprogram)
eval set progopts \$[string toupper $dumpprogram]FLAGS
eval set binary \$[string toupper $dumpprogram]
if { ![is_remote host] && [which $binary] == 0 } {
untested $testname