save-temps_0.c: New file.

2014-03-14  Cesar Philippidis  <cesar@codesourcery.com>

	gcc/testsuite/
	* gcc.dg/lto/save-temps_0.c: New file.
	* lib/gcc-dg.exp (cleanup-saved-temps): Handle LTO temporaries.
	* lib/lto.exp (lto-execute): Cleanup LTO temporaries.

From-SVN: r208563
This commit is contained in:
Cesar Philippidis 2014-03-14 02:33:15 -07:00 committed by Richard Biener
parent 2832dc2203
commit 5cbf2c71aa
4 changed files with 39 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2014-03-14 Cesar Philippidis <cesar@codesourcery.com>
* lib/gcc-dg.exp (cleanup-saved-temps): Handle LTO temporaries.
* lib/lto.exp (lto-execute): Cleanup LTO temporaries.
* gcc.dg/lto/save-temps_0.c: New testcase.
2014-03-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36282

View File

@ -0,0 +1,9 @@
/* { dg-lto-options {{ -O -flto -save-temps}} } */
/* { dg-lto-do link } */
int
main (void)
{
return 0;
}

View File

@ -600,7 +600,7 @@ proc cleanup-saved-temps { args } {
set suffixes {}
# add the to-be-kept suffixes
foreach suffix {".mii" ".ii" ".i" ".s" ".o" ".gkd"} {
foreach suffix {".mii" ".ii" ".i" ".s" ".o" ".gkd" ".res" ".ltrans.out"} {
if {[lsearch $args $suffix] < 0} {
lappend suffixes $suffix
}
@ -611,6 +611,8 @@ proc cleanup-saved-temps { args } {
set testcase [lindex $testcase 0]
foreach suffix $suffixes {
remove-build-file "[file rootname [file tail $testcase]]$suffix"
remove-build-file "[file rootname [file tail $testcase]].exe$suffix"
remove-build-file "[file rootname [file tail $testcase]].exe.ltrans\[0-9\]*$suffix"
# -fcompare-debug dumps
remove-build-file "[file rootname [file tail $testcase]].gk$suffix"
}
@ -620,6 +622,9 @@ proc cleanup-saved-temps { args } {
foreach srcfile $additional_sources {
foreach suffix $suffixes {
remove-build-file "[file rootname [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"
# -fcompare-debug dumps
remove-build-file "[file rootname [file tail $srcfile]].gk$suffix"
}

View File

@ -413,7 +413,8 @@ proc lto-execute { src1 sid } {
global dg-suppress-ld-options
global LTO_OPTIONS
global dg-final-code
global testname_with_flags
# Get extra flags for this test from the primary source file, and
# process other dg-* options that this suite supports. Warn about
# unsupported flags.
@ -577,6 +578,22 @@ proc lto-execute { src1 sid } {
}
}
# Clean up after -save-temps. The LTO tests don't use dg-test, so
# testname-for-summary needs to be defined explicitly for each
# file that needs to be removed.
set testname_with_flags $execname
eval "cleanup-saved-temps"
for {set i 0} {$i < $num_srcs} {incr i} {
set testname_with_flags "${base}_${i}"
eval "cleanup-saved-temps"
set testname_with_flags "${sid}_${base}_${i}"
eval "cleanup-saved-temps"
}
unset testname_with_flags
if { ![string compare "run" $compile_type] \
|| ![string compare "link" $compile_type] } {
file_on_host delete $execname