This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix ${tool}_load's call to saved_${tool}_load


gcc-dg.exp overrides the tool's *_load procedure with:

    proc ${tool}_load { program args } {
	global tool
	global shouldfail
	set result [eval saved_${tool}_load $program $args]

The problem with this is that $args contains up to three elements:
a list of command-line arguments, an input file, and an output file,
but the code above will collapse them into a single argument to
saved_${tool}_load.

I noticed this because c-torture.exp explicitly passes an empty argument
list and an empty input file:

	    set result [gcc_load "$execname" "" ""]

The override of *_load was left over from running compile.exp and
it ended up running:

	set result [saved_${tool}_load $program {"" ""}]

which asks for two empty strings to be passed as arguments to $program.
One of our internal bare-metal dejagnu board files doesn't support
command-line options and marks the test as unsupported.

Sorry, that was a long explanation for a one-line patch.  Tested on
x86_64-linux-gnu with no change in test results.  OK to install?

Richard


gcc/testsuite/
	* lib/gcc-dg.exp (${tool}_load): Fix invocation of
	saved_${tool}_load.

Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- gcc/testsuite/lib/gcc-dg.exp	(revision 119775)
+++ gcc/testsuite/lib/gcc-dg.exp	(working copy)
@@ -196,7 +196,7 @@ if { [info procs ${tool}_load] != [list]
     proc ${tool}_load { program args } {
 	global tool
 	global shouldfail
-	set result [saved_${tool}_load $program $args]
+	set result [eval [list saved_${tool}_load $program] $args]
 	if { $shouldfail != 0 } {
 	    switch [lindex $result 0] {
 		"pass" { set status "fail" }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]