From e489eeb9331efd07f584794f69db5ced3cc959da Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 10 Jun 2003 02:57:48 +0000 Subject: [PATCH] gcc-dg.exp (dg-test): Clear additional_files and additional_sources. * lib/gcc-dg.exp (dg-test): Clear additional_files and additional_sources. From-SVN: r67696 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/gcc-dg.exp | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 39ccaf690a0..c660eca4838 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-06-09 Mark Mitchell + + * lib/gcc-dg.exp (dg-test): Clear additional_files and + additional_sources. + 2003-05-21 David Taylor * gcc.dg/Wpadded.c: New file. diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index aade663aa78..1feadc4a080 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -294,3 +294,31 @@ proc dg-require-gc-sections { args } { return } } + +# We need to make sure that additional_files and additional_sources +# are both cleared out after every test. It is not enough to clear +# them out *before* the next test run because gcc-target-compile gets +# run directly from some .exp files (outside of any test). (Those +# uses should eventually be eliminated.) + +# Because the DG framework doesn't provide a hook that is run at the +# end of a test, we must replace dg-test with a wrapper. + +if { [info procs saved-dg-test] == [list] } { + rename dg-test saved-dg-test + + proc dg-test { args } { + global additional_files + global additional_sources + global errorInfo + + if { [ catch { eval saved-dg-test $args } errmsg ] } { + set saved_info $errorInfo + set additional_files "" + set additional_sources "" + error $errmsg $saved_info + } + set additional_files "" + set additional_sources "" + } +} -- 2.30.2