Hello! Attached patch introduces a new cleanup procedure to remove -fdump-final-insns dumps.
2015-02-26 Uros Bizjak <ubiz...@gmail.com> * lib/gcc-dg.exp (cleanup-final-insns-dump): New procedure. * g++.dg/opt/dump1.C (dg-final): Call cleanup-final-insns-dump. Tested on x86_64-linux-gnu. OK for mainline? Uros.
Index: lib/gcc-dg.exp =================================================================== --- lib/gcc-dg.exp (revision 220999) +++ lib/gcc-dg.exp (working copy) @@ -548,6 +548,21 @@ cleanup-dump "\[0-9\]\[0-9\]\[0-9\]i.$suffix" } +# Remove a final insns dump file for the current test. +proc cleanup-final-insns-dump { } { + set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set testcase [lindex $testcase 0] + remove-build-file "[file rootname [file tail $testcase]].s.gkd" + + # Clean up files for additional source files. + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { + remove-build-file "[file rootname [file tail $srcfile]].s.gkd" + } + } +} + # Remove a stack usage file for the current test. proc cleanup-stack-usage { } { set testcase [testname-for-summary] Index: g++.dg/opt/dump1.C =================================================================== --- g++.dg/opt/dump1.C (revision 220999) +++ g++.dg/opt/dump1.C (working copy) @@ -1,7 +1,7 @@ // PR c++/57102 // { dg-options "-O2 -fno-inline -fdump-final-insns" } // { dg-do compile { target c++11 } } -// { dg-final cleanup-saved-temps } +// { dg-final cleanup-final-insns-dump } namespace std {