From patchwork Wed Oct 11 08:14:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 824277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-463922-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="pkXSVFcc"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yBmx52SF2z9t38 for ; Wed, 11 Oct 2017 19:14:47 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=djOsilfwd7TVR7WTxtfaPIosn3nIb65uqHY4GmQAJ8lu7lM/SJ iW9vD2RbCqMGP0xde8EcScMvviR1gLUl8Mag9x+gSzfnVQl72b3a5A9pYff0P27V z0fGg8LnXcByMhVUxBn48vVWp8KbF6M9VCpKOzMrZPlUNWw0hXIdmKOlI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=EWbIeciEBjagTvhqNSxEvgbei9E=; b=pkXSVFcc/YsXsSO8ZJVV PlZLEJmrGyKva+MX7QT+NORgHNgVFMvrpL93yPNNPOVi3ww0auYWTAf+Z+PZ0zJr 4vggLpZSRaEtuTVl4wiV7e/0u2mJtSkUw9XRYOJ6wsP2rUTWA05XOOivKB4A0r7y wM9cgO+pE+YMT8ecMSZ5/MI= Received: (qmail 33862 invoked by alias); 11 Oct 2017 08:14:34 -0000 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 Received: (qmail 33740 invoked by uid 89); 11 Oct 2017 08:14:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=fd, $fd X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Oct 2017 08:14:32 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EAF87ABF4; Wed, 11 Oct 2017 08:14:29 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Improve FAIL message for dump-*-times functions. To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Message-ID: <5a820893-e10d-8da9-8ab4-c2983a4d9e1e@suse.cz> Date: Wed, 11 Oct 2017 10:14:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. This patch helps to find why an expected number of scan patterns does not match: FAIL: gcc.dg/unroll-3.c scan-tree-dump-times cunrolli "loop with 3 iterations completely unrolled" 222 (found 1 times) FAIL: c-c++-common/attr-simd-2.c -Wc++-compat scan-assembler-times _ZGVbN4_simd_attr: 111 (found 1 times) Ready to be installed after testing? Thanks, Martin gcc/testsuite/ChangeLog: 2017-10-11 Martin Liska * lib/scanasm.exp: Print how many times a regex pattern is found. * lib/scandump.exp: Likewise. --- gcc/testsuite/lib/scanasm.exp | 5 +++-- gcc/testsuite/lib/scandump.exp | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index bab23e8e165..e90e61c29ae 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -247,10 +247,11 @@ proc scan-assembler-times { args } { set text [read $fd] close $fd - if { [llength [regexp -inline -all -- $pattern $text]] == [lindex $args 1]} { + set pattern_count [llength [regexp -inline -all -- $pattern $text]] + if {$pattern_count == [lindex $args 1]} { pass "$testcase scan-assembler-times $pp_pattern [lindex $args 1]" } else { - fail "$testcase scan-assembler-times $pp_pattern [lindex $args 1]" + fail "$testcase scan-assembler-times $pp_pattern [lindex $args 1] (found $pattern_count times)" } } diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp index 2e6eebfaf33..4a64ac6e05d 100644 --- a/gcc/testsuite/lib/scandump.exp +++ b/gcc/testsuite/lib/scandump.exp @@ -86,6 +86,7 @@ proc scan-dump-times { args } { } set testcase [testname-for-summary] + set times [lindex $args 2] set suf [dump-suffix [lindex $args 3]] set printable_pattern [make_pattern_printable [lindex $args 1]] set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]" @@ -101,10 +102,11 @@ proc scan-dump-times { args } { set text [read $fd] close $fd - if { [llength [regexp -inline -all -- [lindex $args 1] $text]] == [lindex $args 2]} { + set result_count [llength [regexp -inline -all -- [lindex $args 1] $text]] + if {$result_count == $times} { pass "$testname" } else { - fail "$testname" + fail "$testname (found $result_count times)" } }