aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-06-10 02:57:48 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-06-10 02:57:48 +0000
commite489eeb9331efd07f584794f69db5ced3cc959da (patch)
treed3b035ecd8f852bb17fb6f9034df0f3fee61abdd
parent4982b6384adffe54c33ee0f5a15ba2cd3482f1f7 (diff)
downloadgcc-e489eeb9331efd07f584794f69db5ced3cc959da.zip
gcc-e489eeb9331efd07f584794f69db5ced3cc959da.tar.gz
gcc-e489eeb9331efd07f584794f69db5ced3cc959da.tar.bz2
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
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp28
2 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 39ccaf6..c660eca 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-09 Mark Mitchell <mark@codesourcery.com>
+
+ * lib/gcc-dg.exp (dg-test): Clear additional_files and
+ additional_sources.
+
2003-05-21 David Taylor <dtaylor@emc.com>
* gcc.dg/Wpadded.c: New file.
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index aade663..1feadc4 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 ""
+ }
+}