From 891201a1c3a3f36154e8f25872282751860310fa Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 24 Feb 2015 06:55:51 +0000 Subject: [PATCH] Add additional_sources_used 2015-02-24 Tom de Vries PR testsuite/65126 * lib/gcc-defs.exp (additional_sources_used): Add new var. (dg-additional-files-options): Copy additional_sources to additional_sources_used before emptying additional_sources. * lib/gcc-dg.exp (cleanup-coverage-files, cleanup-repo-files) (cleanup-stack-usage, cleanup-ada-spec, cleanup-dump) (cleanup-saved-temps): Use additional_sources_used instead of additional_sources. (dg-test): Reset additional_sources_used. From-SVN: r220929 --- gcc/testsuite/ChangeLog | 12 ++++++++++++ gcc/testsuite/lib/gcc-defs.exp | 3 +++ gcc/testsuite/lib/gcc-dg.exp | 32 +++++++++++++++++++------------- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ff48d0a8bf3..a1d18bb2e40 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2015-02-24 Tom de Vries + + PR testsuite/65126 + * lib/gcc-defs.exp (additional_sources_used): Add new var. + (dg-additional-files-options): Copy additional_sources to + additional_sources_used before emptying additional_sources. + * lib/gcc-dg.exp (cleanup-coverage-files, cleanup-repo-files) + (cleanup-stack-usage, cleanup-ada-spec, cleanup-dump) + (cleanup-saved-temps): Use additional_sources_used instead of + additional_sources. + (dg-test): Reset additional_sources_used. + 2015-02-23 Richard Sandiford PR fortran/63427 diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index 6f6e71928af..a30b1765a94 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -268,6 +268,7 @@ proc dg-additional-options { args } { # main source file. set additional_sources "" +set additional_sources_used "" proc dg-additional-sources { args } { global additional_sources @@ -290,6 +291,7 @@ proc dg-additional-files { args } { proc dg-additional-files-options { options source } { global additional_sources + global additional_sources_used global additional_files set to_download [list] if { $additional_sources != "" } then { @@ -301,6 +303,7 @@ proc dg-additional-files-options { options source } { lappend options "additional_flags=$additional_sources" } set to_download [concat $to_download $additional_sources] + set additional_sources_used "$additional_sources" set additional_sources "" } if { $additional_files != "" } then { diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 443e8ede9bd..5a9102e0144 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -495,14 +495,15 @@ proc cleanup-profile-file { } { # Remove compiler-generated coverage files for the current test. proc cleanup-coverage-files { } { + global additional_sources_used 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]].gc??" # Clean up coverage files for additional source files. - if [info exists additional_sources] { - foreach srcfile $additional_sources { + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { remove-build-file "[file rootname [file tail $srcfile]].gc??" } } @@ -510,6 +511,7 @@ proc cleanup-coverage-files { } { # Remove compiler-generated files from -repo for the current test. proc cleanup-repo-files { } { + global additional_sources_used set testcase [testname-for-summary] # The name might include a list of options; extract the file name. set testcase [lindex $testcase 0] @@ -517,8 +519,8 @@ proc cleanup-repo-files { } { remove-build-file "[file rootname [file tail $testcase]].rpo" # Clean up files for additional source files. - if [info exists additional_sources] { - foreach srcfile $additional_sources { + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { remove-build-file "[file rootname [file tail $srcfile]].o" remove-build-file "[file rootname [file tail $srcfile]].rpo" } @@ -554,8 +556,8 @@ proc cleanup-stack-usage { } { remove-build-file "[file rootname [file tail $testcase]].su" # Clean up files for additional source files. - if [info exists additional_sources] { - foreach srcfile $additional_sources { + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { remove-build-file "[file rootname [file tail $srcfile]].su" } } @@ -563,12 +565,13 @@ proc cleanup-stack-usage { } { # Remove an Ada spec file for the current test. proc cleanup-ada-spec { } { + global additional_sources_used set testcase [testname-for-summary] remove-build-file "[get_ada_spec_filename $testcase]" # Clean up files for additional source files. - if [info exists additional_sources] { - foreach srcfile $additional_sources { + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { remove-build-file "[get_ada_spec_filename $srcfile]" } } @@ -576,6 +579,7 @@ proc cleanup-ada-spec { } { # Remove all dump files with the provided suffix. proc cleanup-dump { suffix } { + global additional_sources_used set testcase [testname-for-summary] # The name might include a list of options; extract the file name. set src [file tail [lindex $testcase 0]] @@ -586,8 +590,8 @@ proc cleanup-dump { suffix } { 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 { + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { 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" @@ -603,7 +607,7 @@ proc cleanup-dump { suffix } { # if there are tests generating them. # ARGS is a list of suffixes to NOT delete. proc cleanup-saved-temps { args } { - global additional_sources + global additional_sources_used set suffixes {} # add the to-be-kept suffixes @@ -625,8 +629,8 @@ proc cleanup-saved-temps { args } { } # Clean up saved temp files for additional source files. - if [info exists additional_sources] { - foreach srcfile $additional_sources { + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { foreach suffix $suffixes { remove-build-file "[file rootname [file tail $srcfile]]$suffix" remove-build-file "[file rootname [file tail $srcfile]].exe$suffix" @@ -746,6 +750,7 @@ if { [info procs saved-dg-test] == [list] } { set saved_info $errorInfo set additional_files "" set additional_sources "" + set additional_sources_used "" set additional_prunes "" set shouldfail 0 if [info exists compiler_conditional_xfail_data] { @@ -759,6 +764,7 @@ if { [info procs saved-dg-test] == [list] } { } set additional_files "" set additional_sources "" + set additional_sources_used "" set additional_prunes "" set shouldfail 0 if [info exists set_target_env_var] { -- 2.30.2