Hi Alexandre! On 2023-04-05T23:38:43-0300, Alexandre Oliva via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > On Apr 5, 2023, Thomas Schwinge <tho...@codesourcery.com> wrote: >> With... > >> Co-authored-by: Thomas Schwinge <tho...@codesourcery.com> > >> ... added, I suppose. > > I wrote the patch based on your report, before even seeing your patch
Eh, given your "Ooh, nice, I didn't know [...]" comment in <https://inbox.sourceware.org/gcc/orr0t6n2q4....@lxoliva.fsfla.org>: On 2023-03-30T04:00:03-0300, Alexandre Oliva via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: | On Mar 29, 2023, Thomas Schwinge <tho...@codesourcery.com> wrote: |> ..., this isn't sufficient. Instead, we should undo the 'rename' at the |> end of 'g++.dg/modules/modules.exp'. OK to push the attached |> "'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899]" |> after proper testing? | | Ooh, nice, I didn't know how to drop the renaming after we were done | with it, [...] ..., I had certainly assumed that you'd learned "how to drop [...]" from looking at my patch. > though I only posted mine later, so I tried to give you credit for the > report in the commit message, but if you feel that the note is > appropriate, sure :-) Thanks again! Thanks. > Here's what I'm checking in. > > > testsuite: fix proc unsupported overriding in modules.exp [PR108899] > > The overrider of proc unsupported in modules.exp had two problems > reported by Thomas Schwinge, even after Jakub Jelínek's fix: > > - it remained in effect while running other dejagnu testsets > > - it didn't quote correctly the argument list passed to it, which > caused test names to be surrounded by curly braces, as in: > > UNSUPPORTED: {...} > > This patch fixes both issues Confirmed, thanks. Grüße Thomas > obsoleting and reverting Jakub's change, > by dropping the overrider and renaming the saved proc back, and by > using uplevel's argument list splicing. > > > Co-authored-by: Thomas Schwinge <tho...@codesourcery.com> > > for gcc/testsuite/ChangeLog > > PR testsuite/108899 > * g++.dg/modules/modules.exp (unsupported): Drop renaming. > Fix quoting. > --- > gcc/testsuite/g++.dg/modules/modules.exp | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/gcc/testsuite/g++.dg/modules/modules.exp > b/gcc/testsuite/g++.dg/modules/modules.exp > index 80aa392bc7f3b..dc302d3d0af48 100644 > --- a/gcc/testsuite/g++.dg/modules/modules.exp > +++ b/gcc/testsuite/g++.dg/modules/modules.exp > @@ -319,15 +319,11 @@ cleanup_module_files [find $DEFAULT_REPO *.gcm] > # so that, after an unsupported result in dg-test, we can skip rather > # than fail subsequent related tests. > set module_do {"compile" "P"} > -if { [info procs unsupported] != [list] \ > - && [info procs saved-unsupported] == [list] } { > - rename unsupported saved-unsupported > - > - proc unsupported { args } { > - global module_do > - lset module_do 1 "N" > - return [saved-unsupported $args] > - } > +rename unsupported modules-saved-unsupported > +proc unsupported { args } { > + global module_do > + lset module_do 1 "N" > + return [uplevel 1 modules-saved-unsupported $args] > } > > # not grouped tests, sadly tcl doesn't have negated glob > @@ -412,4 +408,10 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] { > } > } > > +# Restore the original unsupported proc, lest it will affect > +# subsequent test runs, or even fail renaming if we run modules.exp > +# for multiple targets/multilibs/options. > +rename unsupported {} > +rename modules-saved-unsupported unsupported > + > dg-finish > > > ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955