This patch cleans up positive tests. First, stop on first failure so as to avoid littering the logfile. Second, change the extensions of the generated assembly files to .s-pph and .s+pph to be clear on the provenence of each file.
Index: gcc/testsuite/ChangeLog.pph 2011-04-15 Lawrence Crowl <cr...@google.com> * lib/dg-pph.exp (dg-pph-pos): Stop on first failure. Change names of assembly files to be clear on which is with and without PPH. Index: gcc/testsuite/lib/dg-pph.exp =================================================================== --- gcc/testsuite/lib/dg-pph.exp (revision 172457) +++ gcc/testsuite/lib/dg-pph.exp (working copy) @@ -74,13 +74,13 @@ proc dg-pph-pos { subdir test options ma if { $have_errs } { verbose -log "regular compilation failed" fail "$nshort $options, regular compilation failed" - return + return } if { ! [ file_on_host exists "$bname.s" ] } { - verbose -log "assembly file '$bname.s' missing" - fail "$nshort $options, assembly comparison" - return + verbose -log "regular assembly file '$bname.s' missing" + fail "$nshort $options, regular assembly missing" + return } # Rename the .s file into .s-pph to compare it after the second build. @@ -89,19 +89,33 @@ proc dg-pph-pos { subdir test options ma # Compile a second time using the pph files. dg-test -keep-output $test "$options $mapflag -I." "" - remote_upload host "$bname.s" + + if { $have_errs } { + verbose -log "PPH compilation failed" + fail "$nshort $options, PPH compilation failed" + return + } + + if { ! [ file_on_host exists "$bname.s" ] } { + verbose -log "PPH assembly file '$bname.s' missing" + fail "$nshort $options, PPH assembly missing" + return + } + + # Rename the .s file into .s+pph to compare it. + remote_upload host "$bname.s" "$bname.s+pph" + remote_download host "$bname.s+pph" # Compare the two assembly files. They should be identical. - set tmp [ diff "$bname.s" "$bname.s-pph" ] + set tmp [ diff "$bname.s-pph" "$bname.s+pph" ] if { $tmp == 0 } { - verbose -log "assembly file '$bname.s', '$bname.s-pph' comparison error" - fail "$nshort $options assembly comparison" + verbose -log "assembly file '$bname.s-pph', '$bname.s+pph' comparison error" + fail "$nshort $options assembly comparison" } elseif { $tmp == 1 } { - pass "$nshort $options assembly comparison" + pass "$nshort $options assembly comparison" + file_on_host delete "$bname.s-pph" + file_on_host delete "$bname.s+pph" } else { - fail "$nshort $options assembly comparison" + fail "$nshort $options assembly comparison" } - file_on_host delete "$bname.s" - file_on_host delete "$bname.s-pph" - } -- This patch is available for review at http://codereview.appspot.com/4423044