From patchwork Fri Jul 15 23:00:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gab Charette X-Patchwork-Id: 104921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6415EB6F69 for ; Sat, 16 Jul 2011 09:01:18 +1000 (EST) Received: (qmail 11246 invoked by alias); 15 Jul 2011 23:01:15 -0000 Received: (qmail 11230 invoked by uid 22791); 15 Jul 2011 23:01:13 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jul 2011 23:00:59 +0000 Received: from hpaq7.eem.corp.google.com (hpaq7.eem.corp.google.com [172.25.149.7]) by smtp-out.google.com with ESMTP id p6FN0vUZ019872; Fri, 15 Jul 2011 16:00:57 -0700 Received: from gchare.mtv.corp.google.com (gchare.mtv.corp.google.com [172.18.111.122]) by hpaq7.eem.corp.google.com with ESMTP id p6FN0um1028589; Fri, 15 Jul 2011 16:00:56 -0700 Received: by gchare.mtv.corp.google.com (Postfix, from userid 138564) id EC6331C1EB7; Fri, 15 Jul 2011 16:00:55 -0700 (PDT) To: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org Subject: [pph] Expect checksums for tests marked with pph asm xdiff (issue4744043) Message-Id: <20110715230055.EC6331C1EB7@gchare.mtv.corp.google.com> Date: Fri, 15 Jul 2011 16:00:55 -0700 (PDT) From: gchare@google.com (Gabriel Charette) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Reviewed in person by Lawrence. Shortened XFAIL message from previous patch. Also, quick side note, in the first description of this patch I said I used "exec grep", I meant "exec diff". Gab 2011-07-15 Gabriel Charette * g++.dg/pph/c1builtin-integral.cc: Add expected diff checksum. * g++.dg/pph/c1eabi1.cc: Add expected diff checksum. * g++.dg/pph/p4eabi1.cc: Add expected diff checksum. * lib/dg-pph.exp (dg-pph-pos): Expect checksums for pph asm xdiff. --- This patch is available for review at http://codereview.appspot.com/4744043 diff --git a/gcc/testsuite/g++.dg/pph/c1builtin-integral.cc b/gcc/testsuite/g++.dg/pph/c1builtin-integral.cc index c2fceec..6887b11 100644 --- a/gcc/testsuite/g++.dg/pph/c1builtin-integral.cc +++ b/gcc/testsuite/g++.dg/pph/c1builtin-integral.cc @@ -1,2 +1,2 @@ -// pph asm xdiff +// pph asm xdiff 52758 #include "c0builtin-integral.h" diff --git a/gcc/testsuite/g++.dg/pph/c1eabi1.cc b/gcc/testsuite/g++.dg/pph/c1eabi1.cc index b127f98..3321870 100644 --- a/gcc/testsuite/g++.dg/pph/c1eabi1.cc +++ b/gcc/testsuite/g++.dg/pph/c1eabi1.cc @@ -1,5 +1,5 @@ // { dg-options "-w -fpermissive" } -// pph asm xdiff +// pph asm xdiff 36206 #include "c0eabi1.h" diff --git a/gcc/testsuite/g++.dg/pph/p4eabi1.cc b/gcc/testsuite/g++.dg/pph/p4eabi1.cc index 4247f49..2f0715f 100644 --- a/gcc/testsuite/g++.dg/pph/p4eabi1.cc +++ b/gcc/testsuite/g++.dg/pph/p4eabi1.cc @@ -1,5 +1,5 @@ // { dg-options "-w -fpermissive" } -// pph asm xdiff +// pph asm xdiff 15662 #include "p4eabi1.h" diff --git a/gcc/testsuite/lib/dg-pph.exp b/gcc/testsuite/lib/dg-pph.exp index b706f27..b285ccf 100644 --- a/gcc/testsuite/lib/dg-pph.exp +++ b/gcc/testsuite/lib/dg-pph.exp @@ -128,12 +128,11 @@ proc dg-pph-pos { subdir test options mapflag suffix } { verbose -log "" # Compare the two assembly files. They should be identical. - set adiff [diff "$bname.s-pph" "$bname.s+pph"] + set adiff [catch {exec diff "$bname.s-pph" "$bname.s+pph"} diff_result] # The sources mark when they expect the comparison to differ. - set xdiff [llength [grep $test "pph asm xdiff"]] + set xdiff_entry [grep $test "pph asm xdiff( )*\[0-9\]*"] + set xdiff [llength $xdiff_entry] if { $adiff == 0 } { - fail "$nshort $options comparison failure" - } elseif { $adiff == 1 } { if { $xdiff } { xpass "$nshort $options (assembly comparison)" } else { @@ -141,11 +140,20 @@ proc dg-pph-pos { subdir test options mapflag suffix } { } file_on_host delete "$bname.s-pph" file_on_host delete "$bname.s+pph" - } else { + } elseif { $adiff == 1 } { + verbose -log "Diff obtained:\n$diff_result" if { $xdiff } { - xfail "$nshort $options (assembly comparison)" + set expectedSum [exec tr -d \} << [exec cut -f 4 -d\ << $xdiff_entry]] + set actualSum [exec cut -f 1 -d\ << [exec sum << $diff_result]] + if { $expectedSum == $actualSum } { + xfail "$nshort $options (assembly comparison)" + } else { + fail "$nshort $options (assembly comparison, sums $expectedSum=>$actualSum)" + } } else { fail "$nshort $options (assembly comparison)" } + } else { + fail "$nshort $options comparison failure" } }