On Jul 24, 2020, Thomas Schwinge <tho...@codesourcery.com> wrote: > Please merge in the attached incremental patch to resolve syntax errors.
Thanks, sorry about those. I found out about lset after I posted the proposed patch, and I switched to it over set from [lreplace] to avoid further embarrassing myself ;-) That was no use: it was in the same lines that were missing the closing brackets, and yet I didn't spot them :-/ I gave this a round of testing with my attempt at a multi-offload-target toolchain, but I'm not entirely sure any of the actual offloading tests run far enough as to exercise this code, since I see complaints about missing the actual hardware in the dejagnu logs. So please let me know if you run into any issues with this minor incremental change. Here's what I'm installing shortly. Thanks again, add offload target to testname for pass/fail message From: Alexandre Oliva <ol...@adacore.com> Offload tests that scan dump files may run multiple times, once per offload target, but the test result messages do not mention the offload target, so we may seem to have repeated results. Fixed by modifying the test name so that it contains the offload target name. Co-Authored-By: Thomas Schwinge <tho...@codesourcery.com> for gcc/testsuite/ChangeLog * lib/scanoffload.exp (scoff-testname, scoff-adjust): New. (scoff): Call them. --- gcc/testsuite/lib/scanoffload.exp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/lib/scanoffload.exp b/gcc/testsuite/lib/scanoffload.exp index 1a26e44..9071769 100644 --- a/gcc/testsuite/lib/scanoffload.exp +++ b/gcc/testsuite/lib/scanoffload.exp @@ -22,6 +22,19 @@ proc scoff-format { offtgt suffix } { return ".x$offtgt.mkoffload$suffix" } +# Adjust an offload dump TESTNAME for offload TARGET. +proc scoff-testname { target testname } { + return "$target-$testname" +} + +# Adjust the arglist ARGS, so that argument IDX gets scoff-formatted, +# and argument 0 (the test name) gets scoff-testnamed. +proc scoff-adjust { args idx target } { + lset args $idx "[scoff-format $target [lindex $args $idx]]" + lset args 0 "[scoff-testname $target [lindex $args 0]]" + return $args +} + # Wrapper for scan procs. # Argument 0 is the index of the argument to replace when calling # argument 1 with the remaining arguments. Use end-1 or end or so. @@ -34,7 +47,7 @@ proc scoff { args } { if [info exists offload_target] { set target $offload_target if { "$target" != "disable" } { - eval $prc [lreplace $args $idx $idx "[scoff-format $target [lindex $args $idx]]"] + eval $prc [scoff-adjust $args $idx $target] } } else { global offload_targets @@ -42,7 +55,7 @@ proc scoff { args } { # HSA offloading is doing things differently, doesn't use 'mkoffload'. if { "$target" == "hsa" } continue - eval $prc [lreplace $args $idx $idx "[scoff-format $target [lindex $args $idx]]"] + eval $prc [scoff-adjust $args $idx $target] } } } -- Alexandre Oliva, freedom fighter he/him https://FSFLA.org/blogs/lxo/ Free Software Evangelist Stallman was right, but he's left :( GNU Toolchain Engineer Live long and free, and prosper ethically