Commit 5cbf2c71 by Cesar Philippidis Committed by Richard Biener

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
parent 2832dc22
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> 2014-03-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36282 PR middle-end/36282
......
/* { dg-lto-options {{ -O -flto -save-temps}} } */
/* { dg-lto-do link } */
int
main (void)
{
return 0;
}
...@@ -600,7 +600,7 @@ proc cleanup-saved-temps { args } { ...@@ -600,7 +600,7 @@ proc cleanup-saved-temps { args } {
set suffixes {} set suffixes {}
# add the to-be-kept 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} { if {[lsearch $args $suffix] < 0} {
lappend suffixes $suffix lappend suffixes $suffix
} }
...@@ -611,6 +611,8 @@ proc cleanup-saved-temps { args } { ...@@ -611,6 +611,8 @@ proc cleanup-saved-temps { args } {
set testcase [lindex $testcase 0] set testcase [lindex $testcase 0]
foreach suffix $suffixes { foreach suffix $suffixes {
remove-build-file "[file rootname [file tail $testcase]]$suffix" 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 # -fcompare-debug dumps
remove-build-file "[file rootname [file tail $testcase]].gk$suffix" remove-build-file "[file rootname [file tail $testcase]].gk$suffix"
} }
...@@ -620,6 +622,9 @@ proc cleanup-saved-temps { args } { ...@@ -620,6 +622,9 @@ proc cleanup-saved-temps { args } {
foreach srcfile $additional_sources { foreach srcfile $additional_sources {
foreach suffix $suffixes { foreach suffix $suffixes {
remove-build-file "[file rootname [file tail $srcfile]]$suffix" 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 # -fcompare-debug dumps
remove-build-file "[file rootname [file tail $srcfile]].gk$suffix" remove-build-file "[file rootname [file tail $srcfile]].gk$suffix"
} }
......
...@@ -413,7 +413,8 @@ proc lto-execute { src1 sid } { ...@@ -413,7 +413,8 @@ proc lto-execute { src1 sid } {
global dg-suppress-ld-options global dg-suppress-ld-options
global LTO_OPTIONS global LTO_OPTIONS
global dg-final-code global dg-final-code
global testname_with_flags
# Get extra flags for this test from the primary source file, and # Get extra flags for this test from the primary source file, and
# process other dg-* options that this suite supports. Warn about # process other dg-* options that this suite supports. Warn about
# unsupported flags. # unsupported flags.
...@@ -577,6 +578,22 @@ proc lto-execute { src1 sid } { ...@@ -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] \ if { ![string compare "run" $compile_type] \
|| ![string compare "link" $compile_type] } { || ![string compare "link" $compile_type] } {
file_on_host delete $execname file_on_host delete $execname
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment