This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[pph] Output checksum for new unexpected diff (issue4768041)


Output the diff's sum for unexpected diffs as well (used to only output it when it had changed, but outputting it for new diffs will make it easier to generate the comment required to mark this diff as expected when needed).

Also switched from using exec calls to tr/cut, now using native TCL functions as suggested by Andreas Schwab in issue 4744043 (which was already commited then).

2011-07-18  Gabriel Charette  <gchare@google.com>

	* lib/dg-pph.exp (dg-pph-pos): Output actualSum on unexpected diff.
	Use native TCL functions instead of exec calls to tr and cut.

diff --git a/gcc/testsuite/lib/dg-pph.exp b/gcc/testsuite/lib/dg-pph.exp
index b285ccf..013ccfe 100644
--- a/gcc/testsuite/lib/dg-pph.exp
+++ b/gcc/testsuite/lib/dg-pph.exp
@@ -142,16 +142,16 @@ proc dg-pph-pos { subdir test options mapflag suffix } {
 	file_on_host delete "$bname.s+pph"
     } elseif { $adiff == 1 } {
         verbose -log "Diff obtained:\n$diff_result"
+	set actualSum [lindex [split [exec sum << $diff_result] " "] 0]
 	if { $xdiff } {
-	    set expectedSum [exec tr -d \} << [exec cut -f 4 -d\  << $xdiff_entry]]
-	    set actualSum [exec cut -f 1 -d\  << [exec sum << $diff_result]]
+	    set expectedSum [lindex [split $xdiff_entry " \}"] 3]
 	    if { $expectedSum == $actualSum } {
 	        xfail "$nshort $options (assembly comparison)"
 	    } else {
 	        fail "$nshort $options (assembly comparison, sums $expectedSum=>$actualSum)"
 	    }
 	} else {
-	    fail "$nshort $options (assembly comparison)"
+	    fail "$nshort $options (assembly comparison, sum=$actualSum)"
 	}
     } else {
 	fail "$nshort $options comparison failure"

--
This patch is available for review at http://codereview.appspot.com/4768041


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]