From ce9b5c09a644ffd213cb00f378dfe5cf5a9dd7b8 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Wed, 22 Apr 2020 06:34:49 +0000 Subject: [PATCH] testsuite: Handle --save-temps in schedule-cleanups Some tests use --save-temps, but schedule-cleanups strictly matches -save-temps, so we leave many temporary files after validation. Instead of fixing every offending testcase, it's simpler and future-proof to make schedule-cleanups handle both --save-temps and -save-temps. 2020-04-22 Christophe Lyon gcc/testsuite/ * lib/gcc-dg.exp (schedule-cleanups): Accept --save-temps. --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/lib/gcc-dg.exp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 921f81e9a88..0689f202f64 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-04-22 Christophe Lyon + + * lib/gcc-dg.exp (schedule-cleanups): Accept --save-temps. + 2020-04-22 Martin Sebor PR c++/94510 diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index cccd3ce4742..27cc7c19625 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -171,7 +171,7 @@ proc schedule-cleanups { opts } { verbose "dg-keep-saved-temps ${keep_saved_temps_suffixes}" 2 } # -save-temps -> cleanup-saved-temps() - if [regexp -- {(^|\s+)-save-temps(\s+|$)} $opts] { + if [regexp -- {(^|\s+)-?-save-temps(\s+|$)} $opts] { verbose "Cleanup -save-temps seen" 4 if [info exists keep_saved_temps_suffixes] { append finalcode "cleanup-saved-temps ${keep_saved_temps_suffixes}\n" -- 2.30.2