Hi Alexandre! On 2020-07-14T01:48:41-0300, Alexandre Oliva <ol...@adacore.com> wrote: > Sorry it took me so long to get back to you.
Well, likewise. :-| > On Jun 30, 2020, Thomas Schwinge <tho...@codesourcery.com> wrote: > >> For example, if there are two 'offload_targets' configured, and you do a: > >> PASS: libgomp.c++/scan-offload-1.C scan-offload-tree-dump-times >> optimized "(?n)^main\\._omp_fn\\.0 " 1 >> PASS: libgomp.c++/scan-offload-1.C scan-offload-tree-dump-times >> optimized "(?n)^main\\._omp_fn\\.0 " 1 > >> Can we easily get the respective offload target into that, or even full >> 'scoff-format' if that's easier? I surely could hack up something, but >> can you see an elegant way? > > I'm not sure this is elegant, but... does it work? > Ok to install if it does? (I haven't tested it at all) Looks "good" ;-) to me -- best we can easily get, and certainly good enough. We then change as follows: PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/pr85381.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O2 [-scan-offload-rtl-dump-not-]{+scan-nvptx-none-offload-rtl-dump-not+} mach "nvptx_barsync" ..., that is, instead of 'scan-offload-rtl-dump-not' then display 'scan-nvptx-none-offload-rtl-dump-not'. The latter is no longer the name of the actual procedure called, but it's close enough. Please merge in the attached incremental patch to resolve syntax errors. Grüße Thomas > 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. > > > 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..397420a 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 } { > + set args [lreplace $args $idx $idx "[scoff-format $target [lindex $args > $idx]"] > + set args [lreplace $args 0 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] > } > } > } ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
>From 5f0cd6f67d41c4104927625fbd1e623d9d142480 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge <tho...@codesourcery.com> Date: Fri, 24 Jul 2020 07:59:31 +0200 Subject: [PATCH] into "add offload target to testname for pass/fail message" --- gcc/testsuite/lib/scanoffload.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/lib/scanoffload.exp b/gcc/testsuite/lib/scanoffload.exp index 397420a7529..dd64632c437 100644 --- a/gcc/testsuite/lib/scanoffload.exp +++ b/gcc/testsuite/lib/scanoffload.exp @@ -30,8 +30,8 @@ proc scoff-testname { 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 } { - set args [lreplace $args $idx $idx "[scoff-format $target [lindex $args $idx]"] - set args [lreplace $args 0 0 "[scoff-testname $target [lindex $args 0]"] + set args [lreplace $args $idx $idx "[scoff-format $target [lindex $args $idx]]"] + set args [lreplace $args 0 0 "[scoff-testname $target [lindex $args 0]]"] return $args } -- 2.17.1