* 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
+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>
PR testsuite/20771
return 0;
}
-// { dg-final { cleanup-saved-temps } }
+// { dg-final { cleanup-saved-temps ".s" } }
// in their dejagnu baseboard description) require that the status is
// 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.
-// { 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
// different sentry variables for construction and destruction.
char x[64] = "foobar", y[64];
int i = 39, j = 6, k = 4;
+extern int inside_main;
+
void
main_test (void)
{
struct A b = a;
struct A c = { { 'x' } };
+ inside_main = 1;
+
if (memcmp (b.c, x, 32) || c.c[0] != 'x' || memcmp (c.c + 1, x + 32, 31))
abort ();
if (__builtin_memcpy (y, x, i) != y || memcmp (x, y, 64))
#include <stddef.h>
int x;
-/* { dg-final { cleanup-saved-temps } } */
+/* { dg-final { cleanup-saved-temps ".s" } } */
# For the rest, the default is to compile to .s.
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" ] } {
# Ensure that the PCH file is used, not the original header.
file_on_host delete "$bname$suffix"
dg-test -keep-output $test "$flags -I." ""
file_on_host delete "$bname$suffix.gch"
- if { [ file_on_host exists "$bname.s" ] } {
- remote_upload host "$bname.s" "$bname.s-gch"
- remote_download host "$bname.s-gch"
- gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
- dg-test -keep-output $test $flags "-I."
- remote_upload host "$bname.s"
- set tmp [ diff "$bname.s" "$bname.s-gch" ]
- if { $tmp == 0 } {
- untested "$nshort $flags assembly comparison"
- } elseif { $tmp == 1 } {
- pass "$nshort $flags assembly comparison"
+ if { !$have_errs } {
+ if { [ file_on_host exists "$bname.s" ] } {
+ remote_upload host "$bname.s" "$bname.s-gch"
+ remote_download host "$bname.s-gch"
+ gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
+ dg-test -keep-output $test $flags "-I."
+ remote_upload host "$bname.s"
+ set tmp [ diff "$bname.s" "$bname.s-gch" ]
+ if { $tmp == 0 } {
+ verbose -log "assembly file '$bname.s', '$bname.s-gch' comparison error"
+ 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 {
- 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 {
- 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"
}
}
}
#
# Currently this is only .i, .ii and .s files, but more can be added
# 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
+ 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
# that stores the filename of the testcase in a local variable "name".
# A cleaner solution would require a new DejaGnu release.
upvar 2 name testcase
- remove-build-file "[file rootname [file tail $testcase]].ii"
- remove-build-file "[file rootname [file tail $testcase]].i"
+ foreach suffix $suffixes {
+ remove-build-file "[file rootname [file tail $testcase]]$suffix"
+ }
# Clean up saved temp files for additional source files.
if [info exists additional_sources] {
foreach srcfile $additional_sources {
- remove-build-file "[file rootname [file tail $srcfile]].ii"
- remove-build-file "[file rootname [file tail $srcfile]].i"
+ foreach suffix $suffixes {
+ remove-build-file "[file rootname [file tail $srcfile]]$suffix"
+ }
}
}
}