From patchwork Wed Oct 30 09:41:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 287174 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E9ADB2C0372 for ; Wed, 30 Oct 2013 20:41:50 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type :in-reply-to; q=dns; s=default; b=ci6XqLcQFZkqq1uaQ2RKk61d2qHZMC 04eGzQyBeg+3pOxV/1GjlUl9yAOxSwhq2RSAGyOY8CVtbHc2vvTkzsZUoTCc47RZ 1YaIVOv+LbMHpJsvFEnG2/mj1dCXGXGBY4u9Ty+vHRi2WThDYfb0NaeDJZoCd9aO JqTuVn36nkOL0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type :in-reply-to; s=default; bh=KznxKOEOk0nd2a3agsHi30PhRac=; b=xO+8 S3BtbcViADmyeulRv3bIftP60Wv40zDQTsPiIdwyT8iBzosISoSCGrWbRizLosU3 HJpLTFxpUje5RDeify7mQmNuy7xmITNYv9gq6UW2N554oYn8lv8liBOnG5VVP22V EUDdYKTAJ4LX9FxBFZU5Qkbq5JqrYLQpqSZggUg= Received: (qmail 15103 invoked by alias); 30 Oct 2013 09:41:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15087 invoked by uid 89); 30 Oct 2013 09:41:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ee0-f46.google.com Received: from mail-ee0-f46.google.com (HELO mail-ee0-f46.google.com) (74.125.83.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 30 Oct 2013 09:41:41 +0000 Received: by mail-ee0-f46.google.com with SMTP id c1so497288eek.5 for ; Wed, 30 Oct 2013 02:41:37 -0700 (PDT) X-Received: by 10.14.224.132 with SMTP id x4mr4093076eep.5.1383126097376; Wed, 30 Oct 2013 02:41:37 -0700 (PDT) Received: from nbbrfq.cc.univie.ac.at ([2001:62a:4:203:2e59:e5ff:feb9:72ed]) by mx.google.com with ESMTPSA id k7sm81313358eeg.13.2013.10.30.02.41.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 30 Oct 2013 02:41:36 -0700 (PDT) Date: Wed, 30 Oct 2013 10:41:33 +0100 From: Bernhard Reutner-Fischer To: Jakub Jelinek Cc: GCC Patches , Mike Stump , Janis Johnson , Bernhard Reutner-Fischer Subject: [RFC/CFT] auto-wipe dump files [was: Re: [committed] Fix up bb-slp-31.c testcase] Message-ID: <20131030094133.GA22154@nbbrfq.cc.univie.ac.at> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20131009135650.GQ30970@tucnak.zalov.cz> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes > Hi! > > I've noticed that this testcase doesn't clean up after itself. > Fixed thusly, committed as obvious to trunk. This was nagging me last weekend.. ;) What about automating this? Manual part is attached. The "Adjust all callers" below is too big to send to the list: git grep -l -E "(cleanup-.*-dump|cleanup-saved-temps)" | \ egrep -v "(ChangeLog|/lib/)" | sed -e "s|[^/]*$||" | sort | uniq | \ while read d; do find $d -type f \ -exec sed -i -e "/cleanup-[^-]*[-]*dump/d;/cleanup-saved-temps/d" {} + done Full regstrap on x86_64-unknown-linux-gnu with no regressions with trunk@204119 for configure \ --enable-bootstrap \ --with-system-zlib \ --without-included-gettext \ --disable-werror \ --enable-link-mutex \ --enable-nls \ --enable-plugin \ --enable-__cxa_atexit \ --enable-debug \ --enable-checking=yes,rtl \ --enable-gather-detailed-mem-stats \ --enable-multilib \ --enable-multiarch \ --with-linker-hash-style=both \ --with-as=$BINU/as \ --with-ld=$BINU/ld.gold \ --enable-languages=c,c++,fortran,lto,go,objc,obj-c++ \ && make -k check -j4 Ok for trunk? Comments? Given the "Fix comment delimiter" hunks in the manual patch, i'd suggest to add -Wcomment as default flags where possible to catch these early on in the future. gcc/testsuite/ChangeLog 2013-10-12 Bernhard Reutner-Fischer * lib/gcc-dg.exp (cleanup-ipa-dump, cleanup-rtl-dump, cleanup-tree-dump, cleanup-dump): Remove. Adjust all callers. (schedule-cleanups): New proc. (gcc-dg-test-1): Call it. * lib/profopt.exp (profopt-execute): Likewise. * g++.dg/cdce3.C: Adjust expected line numbers. * gcc.dg/cdce1.c: Likewise. * gcc.dg/cdce2.c: Likewise. * gcc.dg/strlenopt-22.c: Fix comment delimiter. * gcc.dg/strlenopt-24.c: Likewise. * gcc.dg/tree-ssa/vrp26.c: Likewise. * gcc.dg/tree-ssa/vrp28.c: Likewise. * obj-c++.dg/encode-2.mm: Likewise. libgomp/ChangeLog 2013-10-12 Bernhard Reutner-Fischer * testsuite/libgomp.graphite/bounds.c: Adjust for cleanup-tree-dump removal. * testsuite/libgomp.graphite/force-parallel-1.c: Likewise. * testsuite/libgomp.graphite/force-parallel-2.c: Likewise. * testsuite/libgomp.graphite/force-parallel-3.c: Likewise. * testsuite/libgomp.graphite/force-parallel-4.c: Likewise. * testsuite/libgomp.graphite/force-parallel-5.c: Likewise. * testsuite/libgomp.graphite/force-parallel-6.c: Likewise. * testsuite/libgomp.graphite/force-parallel-7.c: Likewise. * testsuite/libgomp.graphite/force-parallel-8.c: Likewise. * testsuite/libgomp.graphite/force-parallel-9.c: Likewise. * testsuite/libgomp.graphite/pr41118.c: Likewise. gcc/ChangeLog 2013-10-12 Bernhard Reutner-Fischer * config/arm/neon-testgen.ml (emit_epilogue): Remove manual call to cleanup-saved-temps. gcc/doc/ChangeLog 2013-10-12 Bernhard Reutner-Fischer * doc/sourcebuild.texi (Clean up generated test files): Expand introduction. (cleanup-ipa-dump, cleanup-rtl-dump, cleanup-tree-dump, cleanup-saved-temps): Remove. From dc181880947cbfb3d652c6d9530cea07cf8280d8 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 18 Oct 2013 21:08:49 +0200 Subject: [PATCH] auto-wipe dump files --- gcc/config/arm/neon-testgen.ml | 1 - gcc/doc/sourcebuild.texi | 19 ++-- gcc/testsuite/g++.dg/cdce3.C | 5 +- gcc/testsuite/gcc.dg/cdce1.c | 3 +- gcc/testsuite/gcc.dg/cdce2.c | 3 +- gcc/testsuite/gcc.dg/strlenopt-22.c | 3 +- gcc/testsuite/gcc.dg/strlenopt-24.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/vrp26.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/vrp28.c | 3 +- gcc/testsuite/lib/dg-pch.exp | 18 +++- gcc/testsuite/lib/gcc-dg.exp | 160 ++++++++++++++++++++++++---------- gcc/testsuite/lib/profopt.exp | 3 + gcc/testsuite/obj-c++.dg/encode-2.mm | 3 +- 13 files changed, 151 insertions(+), 76 deletions(-) diff --git a/gcc/config/arm/neon-testgen.ml b/gcc/config/arm/neon-testgen.ml index 543318b..4734ac0 100644 --- a/gcc/config/arm/neon-testgen.ml +++ b/gcc/config/arm/neon-testgen.ml @@ -139,7 +139,6 @@ let emit_epilogue chan features regexps = else () ); - Printf.fprintf chan "/* { dg-final { cleanup-saved-temps } } */\n" (* Check a list of C types to determine which ones are pointers and which ones are const. *) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 1a70916..7e0ebd9 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2145,13 +2145,17 @@ Check branch and/or call counts, in addition to line counts, in @subsubsection Clean up generated test files +Usually the test-framework removes files that were generated during +testing. If a testcase, for example, uses any dumping mechanism to +inspect a passes dump file, the testsuite recognized the dumping option +passed to the tool and schedules a final cleanup to remove these files. + +There are, however, following additional cleanup directives that can be +used to annotate a testcase "manually". @table @code @item cleanup-coverage-files Removes coverage data files generated for this test. -@item cleanup-ipa-dump @var{suffix} -Removes IPA dump files generated for this test. - @item cleanup-modules "@var{list-of-extra-modules}" Removes Fortran module files generated for this test, excluding the module names listed in keep-modules. @@ -2192,15 +2196,6 @@ Removes profiling files generated for this test. @item cleanup-repo-files Removes files generated for this test for @option{-frepo}. -@item cleanup-rtl-dump @var{suffix} -Removes RTL dump files generated for this test. - -@item cleanup-saved-temps -Removes files for the current test which were kept for @option{-save-temps}. - -@item cleanup-tree-dump @var{suffix} -Removes tree dump files matching @var{suffix} which were generated for -this test. @end table @node Ada Tests diff --git a/gcc/testsuite/g++.dg/cdce3.C b/gcc/testsuite/g++.dg/cdce3.C index 726e9ec..3937953 100644 --- a/gcc/testsuite/g++.dg/cdce3.C +++ b/gcc/testsuite/g++.dg/cdce3.C @@ -4,8 +4,9 @@ /* { dg-additional-options "-DLARGE_LONG_DOUBLE" { target large_long_double } } */ /* { dg-additional-options "-DGNU_EXTENSION" { target pow10 } } */ /* { dg-add-options ieee } */ +/* { dg-final { scan-tree-dump "cdce3.C:91: note: function call is shrink-wrapped into error conditions\." "cdce" { target pow10 } } } */ /* { dg-final { scan-tree-dump "cdce3.C:92: note: function call is shrink-wrapped into error conditions\." "cdce" { target pow10 } } } */ -/* { dg-final { scan-tree-dump "cdce3.C:93: note: function call is shrink-wrapped into error conditions\." "cdce" { target pow10 } } } */ +/* { dg-final { scan-tree-dump "cdce3.C:94: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { scan-tree-dump "cdce3.C:95: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { scan-tree-dump "cdce3.C:96: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { scan-tree-dump "cdce3.C:97: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ @@ -19,8 +20,6 @@ /* { dg-final { scan-tree-dump "cdce3.C:105: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { scan-tree-dump "cdce3.C:106: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { scan-tree-dump "cdce3.C:107: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ -/* { dg-final { scan-tree-dump "cdce3.C:108: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ -/* { dg-final { cleanup-tree-dump "cdce" } } */ #include #include diff --git a/gcc/testsuite/gcc.dg/cdce1.c b/gcc/testsuite/gcc.dg/cdce1.c index 2123f7f..02b47c0 100644 --- a/gcc/testsuite/gcc.dg/cdce1.c +++ b/gcc/testsuite/gcc.dg/cdce1.c @@ -1,8 +1,7 @@ /* { dg-do run } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ /* { dg-require-effective-target int32plus } */ -/* { dg-final { scan-tree-dump "cdce1.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ -/* { dg-final { cleanup-tree-dump "cdce" } } */ +/* { dg-final { scan-tree-dump "cdce1.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-require-effective-target large_double } */ #include diff --git a/gcc/testsuite/gcc.dg/cdce2.c b/gcc/testsuite/gcc.dg/cdce2.c index a461ce7..dafaeab 100644 --- a/gcc/testsuite/gcc.dg/cdce2.c +++ b/gcc/testsuite/gcc.dg/cdce2.c @@ -1,8 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ -/* { dg-final { scan-tree-dump "cdce2.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/ -/* { dg-final { cleanup-tree-dump "cdce" } } */ +/* { dg-final { scan-tree-dump "cdce2.c:15: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/ #include #include diff --git a/gcc/testsuite/gcc.dg/strlenopt-22.c b/gcc/testsuite/gcc.dg/strlenopt-22.c index d6fd4df..aa55f5e 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-22.c +++ b/gcc/testsuite/gcc.dg/strlenopt-22.c @@ -36,5 +36,4 @@ main () /* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */ /* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */ /* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */ -/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } * -/* { dg-final { cleanup-tree-dump "strlen" } } */ +/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-24.c b/gcc/testsuite/gcc.dg/strlenopt-24.c index 962e04f..639501a 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-24.c +++ b/gcc/testsuite/gcc.dg/strlenopt-24.c @@ -13,5 +13,4 @@ main () return 0; } -/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } * -/* { dg-final { cleanup-tree-dump "strlen" } } */ +/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c index 6215416..021d2de 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c @@ -9,8 +9,7 @@ foo(int a) } /* VRP should optimize this to a trivial "return 1". */ -/* { dg-final { scan-tree-dump-times "return 1" 1 "vrp1" } } * / -/* { dg-final { cleanup-tree-dump "vrp1" } } */ +/* { dg-final { scan-tree-dump-times "return 1" 1 "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c index 6b2a1fd..8c2a72b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c @@ -26,7 +26,6 @@ int f3 (unsigned char c) return 0; } -/* { dg-final { scan-tree-dump-times "if " 0 "vrp1" } } * / -/* { dg-final { cleanup-tree-dump "vrp1" } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "vrp1" } } */ diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index f64f4a1..1f96226 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -106,6 +106,121 @@ if { $orig_environment_saved == 0 } { set_ld_library_path_env_vars } +# Deduce generated files from tool flags, return finalcode string +proc schedule-cleanups { opts } { + global additional_sources + set finalcode "" + set testcases {} + lappend testcases [lindex [testname-for-summary] 0] + verbose "Cleanup testcases: $testcases" 4 + if { [info exists additional_sources] && $additional_sources != "" } { + lappend testcases $additional_sources + verbose "Cleanup testcases, additional: $additional_sources" 4 + } + # tuple of . where might be '*' for all + set fams {} + verbose "Cleanup all options: $opts" 4 + + # fixups + # --dump= should translate to -d with joined operand. + if [regexp -- {(^|\s+)--dump=[^\s]+(\s+|$)} $opts] { + regsub -all -- {--dump=} $opts {-d} opts + } + # ??? -fdump-class-hierarchy misnomer: missing -tree + if [regexp -- {(^|\s+)-fdump-class-hierarchy(\s+|$)} $opts] { + regsub -all -- {-fdump-class-hierarchy} $opts {-fdump-tree-class-hierarchy} opts + } + + # -fprofile-generate -> cleanup-coverage-files() + # -fstack-usage -> cleanup-stack-usage() + if [regexp -- {(^|\s+)-fstack-usage(\s+|$)} $opts] { + verbose "Cleanup -fstack-usage seen" 4 +# append finalcode "cleanup-stack-usage\n" + } + # -save-temps -> cleanup-saved-temps() + if [regexp -- {(^|\s+)-save-temps(\s+|$)} $opts] { + verbose "Cleanup -save-temps seen" 4 + append finalcode "cleanup-saved-temps\n" + } + if [regexp -- {(^|\s+)-da(\s+|$)} $opts] { # shorthand for -fdump-rtl-all + verbose "Cleanup -da seen" 4 + lappend fams "r" + } + if [regexp -- {(^|\s+)-flto(\s+|$)} $opts] { + verbose "Cleanup -flto seen" 4 + set ltrans "{ltrans\[0-9\]*.,}" + } else { + set ltrans "" + } + + # -fdump--- (plus exceptions) + set dflags [regexp -all -inline -- {(?=(?:^|[ \t]+)?)-fdump-[^ \t]+(?=(?:$|[ \t]+)?)} $opts] + verbose "Cleanup -fdump-* flags: $dflags" 4 + foreach d $dflags { + verbose "Cleanup examine $d" 4 + foreach { _ fam pas lvl } \ + [regexp -all -inline -- {[^-]+(?=(?:-)?)} $d] { + regsub -- {^all$} $pas {*} pas + # -fdump-rtl--graph -> .dot and ignore rest + set lvl [lindex [list "" ".dot"] [string equal "graph" $lvl]] + verbose "Cleanup fam=$fam pas=$pas lvl=$lvl" 4 + if [regexp {(rtl|tree|ipa)} $fam] { + # per-pass in the light of -fdump-tree-local-pure-const1 + # is a bit too much for the moment.. + set f [string index $fam 0] + if { [lsearch -exact $fams $f] < 0 } { + lappend fams $f + } + } + } + } + if { [llength $fams] < 1 } { + return $finalcode + } elseif { [llength $fams] == 1 } { + set fams [lindex $fams 0] + } else { + set fams [join $fams ","] + set fams "{$fams}" + } + # stem.ext.. + # (tree)passes can have multiple instances, thus optional trailing [0-9] + # That will generate *{\[0-9\],} for -fdump-fam-all but is nicer otherwise + #set tuples "\[0-9\]\[0-9\]\[0-9\]$tuples{\[0-9\],}" + set fams "\[0-9\]\[0-9\]\[0-9\]$fams.*" + set fams "$ltrans$fams" + verbose "Cleanup final fams: $fams" 4 + set tfiles {} + foreach src $testcases { + set basename [file tail $src] + if { $ltrans != "" } { + # ??? should we use upvar 1 output_file instead of this (dup ?) + set stem [file rootname $basename] + set basename_ext [file extension $basename] + if {$basename_ext != ""} { + regsub -- {^.*\.} $basename_ext {} basename_ext + } + lappend tfiles "$stem.{$basename_ext,exe}" + unset basename_ext + } else { + lappend tfiles $basename + } + } + if { [llength $tfiles] > 1 } { + set tfiles [join $tfiles ","] + set tfiles "{$tfiles}" + } + verbose "Cleanup final testcases: $tfiles" 4 + # We have to quote the regex + regsub -all {([][$^?+*()|\\{}])} "$tfiles.$fams" {\\\1} ptn + set final "" + append final {remove-build-file } + append final "\"$ptn\"" + verbose "Cleanup final: $final" 4 + append finalcode "$final\n" + + return $finalcode +} + # Define gcc callbacks for dg.exp. proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } { @@ -177,6 +292,7 @@ proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } { } } + append finalcode [schedule-cleanups "$options $extra_tool_flags"] if { $extra_tool_flags != "" } { lappend options "additional_flags=$extra_tool_flags" } @@ -518,27 +634,6 @@ proc cleanup-repo-files { } { } } -# Remove compiler-generated RTL dump files for the current test. -# -# SUFFIX is the filename suffix pattern. -proc cleanup-rtl-dump { suffix } { - cleanup-dump "\[0-9\]\[0-9\]\[0-9\]r.$suffix" -} - -# Remove a specific tree dump file for the current test. -# -# SUFFIX is the tree dump file suffix pattern. -proc cleanup-tree-dump { suffix } { - cleanup-dump "\[0-9\]\[0-9\]\[0-9\]t.$suffix" -} - -# Remove a specific ipa dump file for the current test. -# -# SUFFIX is the ipa dump file suffix pattern. -proc cleanup-ipa-dump { suffix } { - cleanup-dump "\[0-9\]\[0-9\]\[0-9\]i.$suffix" -} - # Remove a stack usage file for the current test. proc cleanup-stack-usage { } { set testcase [testname-for-summary] @@ -567,29 +662,6 @@ proc cleanup-ada-spec { } { } } -# Remove all dump files with the provided suffix. -proc cleanup-dump { suffix } { - set testcase [testname-for-summary] - # The name might include a list of options; extract the file name. - set src [file tail [lindex $testcase 0]] - remove-build-file "[file tail $src].$suffix" - remove-build-file "[file rootname [file tail $src]].exe.$suffix" - remove-build-file "[file rootname [file tail $src]].exe.ltrans\[0-9\]*.$suffix" - # -fcompare-debug dumps - remove-build-file "[file tail $src].gk.$suffix" - - # Clean up dump files for additional source files. - if [info exists additional_sources] { - foreach srcfile $additional_sources { - remove-build-file "[file tail $srcfile].$suffix" - remove-build-file "[file rootname [file tail $srcfile]].exe.$suffix" - remove-build-file "[file rootname [file tail $srcfile]].exe.ltrans\[0-9\]*.$suffix" - # -fcompare-debug dumps - remove-build-file "[file tail $srcfile].gk.$suffix" - } - } -} - # Remove files kept by --save-temps for the current test. # # Currently this is only .i, .ii, .s and .o files, but more can be added diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp index cdc6b00..a5aa84d 100644 --- a/gcc/testsuite/lib/profopt.exp +++ b/gcc/testsuite/lib/profopt.exp @@ -283,6 +283,9 @@ proc profopt-execute { src } { return } + # schedule removal of dump files et al + # Do this before the call below destroys additional_sources.. + append use_final_code [schedule-cleanups "$option $extra_flags"] set extra_options [dg-additional-files-options "" "$src"] # Tree profiling requires TLS runtime support, which may need diff --git a/gcc/testsuite/obj-c++.dg/encode-2.mm b/gcc/testsuite/obj-c++.dg/encode-2.mm index 157bb52..77eb6ad 100644 --- a/gcc/testsuite/obj-c++.dg/encode-2.mm +++ b/gcc/testsuite/obj-c++.dg/encode-2.mm @@ -24,5 +24,4 @@ const char *enc3 = @encode(anonymous); /* { dg-final { scan-assembler "{Vec=ffi}" } } */ /* { dg-final { scan-assembler "{Vec=ddi}" } } */ -/* { dg-final { scan-file "encode-2.o" "{?={Vec=ddi}{Vec=ffi}fd{Vec=cci}i}" } } -/* { dg-final cleanup-saved-temps } */ +/* { dg-final { scan-file "encode-2.o" "{?={Vec=ddi}{Vec=ffi}fd{Vec=cci}i}" } } */ -- 1.8.4.rc3