aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-06 20:28:46 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-06 20:28:46 +0000
commitddcb84ccf48b75b2d9f65a49ccc80af90a6768f8 (patch)
tree96a46fcad1ef04c5f5d2a2c610a405178827efcd
parent47974985b70ed897413ccefda4e49ccae2a75dee (diff)
gcc/testsuite/
* lib/dg-pch.exp (dg-pch): Don't expect .s files if there are dg-errors expected. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@118527 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.csl4
-rw-r--r--gcc/testsuite/lib/dg-pch.exp43
2 files changed, 30 insertions, 17 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index b45d8993914..543641e81ac 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,6 +1,10 @@
2006-11-06 Nathan Sidwell <nathan@codesourcery.com>
gcc/testsuite/
+ * lib/dg-pch.exp (dg-pch): Don't expect .s files if there are
+ dg-errors expected.
+
+ gcc/testsuite/
* 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.
diff --git a/gcc/testsuite/lib/dg-pch.exp b/gcc/testsuite/lib/dg-pch.exp
index ac8bafcfd0f..8de2cc4fec2 100644
--- a/gcc/testsuite/lib/dg-pch.exp
+++ b/gcc/testsuite/lib/dg-pch.exp
@@ -44,34 +44,43 @@ proc dg-pch { subdir test options suffix } {
# 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 exists "$bname$suffix.gch" ] } {
# Ensure that the PCH file is used, not the original header.
file delete "$bname$suffix"
dg-test -keep-output $test $flags "-I."
file delete "$bname$suffix.gch"
- if { [ file exists "$bname.s" ] } {
- file rename "$bname.s" "$bname.s-gch"
- gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
- dg-test -keep-output $test $flags "-I."
- 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 exists "$bname.s" ] } {
+ file rename "$bname.s" "$bname.s-gch"
+ gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
+ dg-test -keep-output $test $flags "-I."
+ set tmp [ diff "$bname.s" "$bname.s-gch" ]
+ if { $tmp == 0 } {
+ verbose -log "assembly file '$bname.s', '$bname.s-gch' comparison error" 1
+ fail "$nshort $flags assembly comparison"
+ } elseif { $tmp == 1 } {
+ pass "$nshort $flags assembly comparison"
+ } else {
+ fail "$nshort $flags assembly comparison"
+ }
+ file delete "$bname$suffix"
+ file delete "$bname.s"
+ file delete "$bname.s-gch"
} else {
+ verbose -log "assembly file '$bname.s' missing" 1
fail "$nshort $flags assembly comparison"
}
- file delete "$bname$suffix"
- file delete "$bname.s"
- file delete "$bname.s-gch"
- } else {
- untested "$nshort $flags assembly comparison"
}
-
} else {
- untested "$nshort $flags"
- untested "$nshort $flags assembly comparison"
+ verbose -log "assembly file '$bname$suffix.gch' missing" 1
+ fail "$nshort $flags"
+ if { !$have_errs } {
+ verbose -log "assembly file '$bname.s' missing" 1
+ fail "$nshort $flags assembly comparison"
+ }
}
}
}