Commit 765f7c95 by Nathan Sidwell Committed by Nathan Sidwell

memops-asm.c: Set inside_main.

	* gcc.c-torture/execute/builtins/memops-asm.c: Set inside_main.

	* lib/gcc-dg.exp (cleanup-saved-temps): Add optional list of
	suffixes not to delete.
	* gcc.dg/pch/save-temps-1.c: Don't delete ".s" temp.
	* g++.dg/pch/pch.C: Likewise.

	* g++.old-deja/g++.pt/static11.C: Replace xfail by target requirement.

	* lib/dg-pch.exp (dg-pch): Don't expect .s files if there are
	dg-errors expected.

From-SVN: r135708
parent 32723ea0
2008-05-20 Nathan Sidwell <nathan@codesourcery.com>
* gcc.c-torture/execute/builtins/memops-asm.c: Set inside_main.
* lib/gcc-dg.exp (cleanup-saved-temps): Add optional list of
suffixes not to delete.
* gcc.dg/pch/save-temps-1.c: Don't delete ".s" temp.
* g++.dg/pch/pch.C: Likewise.
* g++.old-deja/g++.pt/static11.C: Replace xfail by target requirement.
* lib/dg-pch.exp (dg-pch): Don't expect .s files if there are
dg-errors expected.
2008-05-20 Janis Johnson <janis187@us.ibm.com> 2008-05-20 Janis Johnson <janis187@us.ibm.com>
PR testsuite/20771 PR testsuite/20771
......
...@@ -6,4 +6,4 @@ int main() ...@@ -6,4 +6,4 @@ int main()
return 0; return 0;
} }
// { dg-final { cleanup-saved-temps } } // { dg-final { cleanup-saved-temps ".s" } }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// in their dejagnu baseboard description) require that the status is // in their dejagnu baseboard description) require that the status is
// final when exit is entered (or main returns), and not "overruled" by a // final when exit is entered (or main returns), and not "overruled" by a
// destructor calling _exit. It's not really worth it to handle that. // destructor calling _exit. It's not really worth it to handle that.
// { dg-do run { xfail mmix-knuth-mmixware arm*-*-elf arm*-*-eabi m68k-*-elf } } // { dg-do run { target unwrapped } }
// Bug: g++ was failing to destroy C<int>::a because it was using two // Bug: g++ was failing to destroy C<int>::a because it was using two
// different sentry variables for construction and destruction. // different sentry variables for construction and destruction.
......
...@@ -22,12 +22,16 @@ struct A { char c[32]; } a = { "foobar" }; ...@@ -22,12 +22,16 @@ struct A { char c[32]; } a = { "foobar" };
char x[64] = "foobar", y[64]; char x[64] = "foobar", y[64];
int i = 39, j = 6, k = 4; int i = 39, j = 6, k = 4;
extern int inside_main;
void void
main_test (void) main_test (void)
{ {
struct A b = a; struct A b = a;
struct A c = { { 'x' } }; struct A c = { { 'x' } };
inside_main = 1;
if (memcmp (b.c, x, 32) || c.c[0] != 'x' || memcmp (c.c + 1, x + 32, 31)) if (memcmp (b.c, x, 32) || c.c[0] != 'x' || memcmp (c.c + 1, x + 32, 31))
abort (); abort ();
if (__builtin_memcpy (y, x, i) != y || memcmp (x, y, 64)) if (__builtin_memcpy (y, x, i) != y || memcmp (x, y, 64))
......
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
#include <stddef.h> #include <stddef.h>
int x; int x;
/* { dg-final { cleanup-saved-temps } } */ /* { dg-final { cleanup-saved-temps ".s" } } */
...@@ -44,36 +44,45 @@ proc dg-pch { subdir test options suffix } { ...@@ -44,36 +44,45 @@ proc dg-pch { subdir test options suffix } {
# For the rest, the default is to compile to .s. # For the rest, the default is to compile to .s.
set dg-do-what-default compile set dg-do-what-default compile
set have_errs [llength [grep $test "{\[ \t\]\+dg-error\[ \t\]\+.*\[ \t\]\+}"]]
if { [ file_on_host exists "$bname$suffix.gch" ] } { if { [ file_on_host exists "$bname$suffix.gch" ] } {
# Ensure that the PCH file is used, not the original header. # Ensure that the PCH file is used, not the original header.
file_on_host delete "$bname$suffix" file_on_host delete "$bname$suffix"
dg-test -keep-output $test "$flags -I." "" dg-test -keep-output $test "$flags -I." ""
file_on_host delete "$bname$suffix.gch" file_on_host delete "$bname$suffix.gch"
if { [ file_on_host exists "$bname.s" ] } { if { !$have_errs } {
remote_upload host "$bname.s" "$bname.s-gch" if { [ file_on_host exists "$bname.s" ] } {
remote_download host "$bname.s-gch" remote_upload host "$bname.s" "$bname.s-gch"
gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix" remote_download host "$bname.s-gch"
dg-test -keep-output $test $flags "-I." gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
remote_upload host "$bname.s" dg-test -keep-output $test $flags "-I."
set tmp [ diff "$bname.s" "$bname.s-gch" ] remote_upload host "$bname.s"
if { $tmp == 0 } { set tmp [ diff "$bname.s" "$bname.s-gch" ]
untested "$nshort $flags assembly comparison" if { $tmp == 0 } {
} elseif { $tmp == 1 } { verbose -log "assembly file '$bname.s', '$bname.s-gch' comparison error"
pass "$nshort $flags assembly comparison" fail "$nshort $flags assembly comparison"
} elseif { $tmp == 1 } {
pass "$nshort $flags assembly comparison"
} else {
fail "$nshort $flags assembly comparison"
}
file_on_host delete "$bname$suffix"
file_on_host delete "$bname.s"
file_on_host delete "$bname.s-gch"
} else { } else {
fail "$nshort $flags assembly comparison" verbose -log "assembly file '$bname.s' missing"
fail "$nshort $flags assembly comparison"
} }
file_on_host delete "$bname$suffix"
file_on_host delete "$bname.s"
file_on_host delete "$bname.s-gch"
} else { } else {
untested "$nshort $flags assembly comparison" verbose -log "assembly file '$bname$suffix.gch' missing"
fail "$nshort $flags"
if { !$have_errs } {
verbose -log "assembly file '$bname.s' missing" 1
fail "$nshort $flags assembly comparison"
}
} }
} else {
untested "$nshort $flags"
untested "$nshort $flags assembly comparison"
} }
} }
} }
...@@ -441,21 +441,32 @@ proc cleanup-dump { suffix } { ...@@ -441,21 +441,32 @@ proc cleanup-dump { suffix } {
# #
# Currently this is only .i, .ii and .s files, but more can be added # Currently this is only .i, .ii and .s files, but more can be added
# if there are tests generating them. # if there are tests generating them.
proc cleanup-saved-temps { } { # ARGS is a list of suffixes to NOT delete.
proc cleanup-saved-temps { args } {
global additional_sources global additional_sources
set suffixes {}
# add the to-be-kept suffixes
foreach suffix {".ii" ".i" ".s"} {
if {[lsearch $args $suffix] < 0} {
lappend suffixes $suffix
}
}
# This assumes that we are two frames down from dg-test or some other proc # This assumes that we are two frames down from dg-test or some other proc
# that stores the filename of the testcase in a local variable "name". # that stores the filename of the testcase in a local variable "name".
# A cleaner solution would require a new DejaGnu release. # A cleaner solution would require a new DejaGnu release.
upvar 2 name testcase upvar 2 name testcase
remove-build-file "[file rootname [file tail $testcase]].ii" foreach suffix $suffixes {
remove-build-file "[file rootname [file tail $testcase]].i" remove-build-file "[file rootname [file tail $testcase]]$suffix"
}
# Clean up saved temp files for additional source files. # Clean up saved temp files for additional source files.
if [info exists additional_sources] { if [info exists additional_sources] {
foreach srcfile $additional_sources { foreach srcfile $additional_sources {
remove-build-file "[file rootname [file tail $srcfile]].ii" foreach suffix $suffixes {
remove-build-file "[file rootname [file tail $srcfile]].i" remove-build-file "[file rootname [file tail $srcfile]]$suffix"
}
} }
} }
} }
......
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