From patchwork Sun Nov 27 20:41:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 127903 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 2EA39B6F9C for ; Mon, 28 Nov 2011 07:41:26 +1100 (EST) Received: (qmail 25066 invoked by alias); 27 Nov 2011 20:41:25 -0000 Received: (qmail 25053 invoked by uid 22791); 27 Nov 2011 20:41:24 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Nov 2011 20:41:09 +0000 Received: by wwo28 with SMTP id 28so8172221wwo.8 for ; Sun, 27 Nov 2011 12:41:08 -0800 (PST) Received: by 10.180.81.163 with SMTP id b3mr42317425wiy.20.1322426468052; Sun, 27 Nov 2011 12:41:08 -0800 (PST) Received: by 10.180.81.163 with SMTP id b3mr42317419wiy.20.1322426468002; Sun, 27 Nov 2011 12:41:08 -0800 (PST) Received: from [192.168.44.105] (5ac3c889.bb.sky.com. [90.195.200.137]) by mx.google.com with ESMTPS id a27sm36497373wbp.16.2011.11.27.12.41.06 (version=SSLv3 cipher=OTHER); Sun, 27 Nov 2011 12:41:06 -0800 (PST) Message-ID: <4ED2A060.30802@acm.org> Date: Sun, 27 Nov 2011 20:41:04 +0000 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15 MIME-Version: 1.0 To: GCC Patches Subject: [testsuite] xfail target-specific asms, & gcov 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 I couldn't figure out a way to have a scan-assembler check be specific to a particular target and xfailed. It appeared one could have one or the other, but not both. this patch extends scan-assembler (and scan-assembler-not) to allow something like: /* { dg-final { scan-assembler "\\.hidden\t__gcov___ZN1X4FinkEv" { target { ! *-*-darwin* } } { xfail *-*-* } } } */ If there's already a way to do this, I'm all ears. The other part of the patch allows gcov tests to be xfailed, both the gcov processing itself, and individual line counts. It appears that there used to be some support for this, but it had severely bit rotted. For instance one will be able to append { xfail ... } to a count(...) line. The goal of these patches is so I can xfail some of the recent gcov tests I've added when I revert part of the changes that are causing the problem left in PR51113. That defect is showing that a deeper analysis is needed. While I'm doing that, it'd be good to unbreak things even if it means losing some of the new feature I attempted to add. ok? nathan 2011-11-27 Nathan Sidwell * lib/scanasm.exp (dg-scan): Allow multiple target options. * lib/gcov.exp (verify-lines): Add support for xfailing. (run-gcov): Likewise. Index: testsuite/lib/scanasm.exp =================================================================== --- testsuite/lib/scanasm.exp (revision 181744) +++ testsuite/lib/scanasm.exp (working copy) @@ -37,12 +37,9 @@ proc dg-scan { name positive testcase ou error "$name: too few arguments" return } - if { [llength $orig_args] > 2 } { - error "$name: too many arguments" - return - } - if { [llength $orig_args] >= 2 } { - switch [dg-process-target [lindex $orig_args 1]] { + set len [llength $orig_args] + for {set arg 1} {$arg < $len} {incr arg} { + switch [dg-process-target [lindex $orig_args $arg]] { "S" { } "N" { return } "F" { setup_xfail "*-*-*" } Index: testsuite/lib/gcov.exp =================================================================== --- testsuite/lib/gcov.exp (revision 181744) +++ testsuite/lib/gcov.exp (working copy) @@ -39,19 +39,28 @@ proc clean-gcov { testcase } { # proc verify-lines { testcase file } { #send_user "verify-lines\n" + global subdir set failed 0 set fd [open $file r] while { [gets $fd line] >= 0 } { # We want to match both "-" and "#####" as count as well as numbers, # since we want to detect lines that shouldn't be marked as covered. - if [regexp "^ *(\[^:]*): *(\[0-9\\-#]+):.*count\\((\[0-9\\-#]+)\\)" \ - "$line" all is n shouldbe] { + if [regexp "^ *(\[^:]*): *(\[0-9\\-#]+):.*count\\((\[0-9\\-#]+)\\)(.*)" \ + "$line" all is n shouldbe rest] { + if [regexp "^ *{(.*)}" $rest all xfailed] { + switch [dg-process-target $xfailed] { + "N" { continue } + "F" { setup_xfail "*-*-*" } + } + } if { $is == "" } { - fail "$n:no data available for this line" + fail "$subdir/$testcase:$n:no data available for this line" incr failed } elseif { $is != $shouldbe } { - fail "$n:is $is:should be $shouldbe" + fail "$subdir/$testcase:$n:is $is:should be $shouldbe" incr failed + } else { + pass "$subdir/$testcase:$n line count" } } } @@ -230,32 +239,36 @@ proc run-gcov { args } { global GCOV global srcdir subdir - set gcov_args [lindex $args end] - + set gcov_args "" set gcov_verify_calls 0 set gcov_verify_branches 0 - set gcov_execute_xfail "" - set gcov_verify_xfail "" + set xfailed 0 foreach a $args { if { $a == "calls" } { set gcov_verify_calls 1 } elseif { $a == "branches" } { set gcov_verify_branches 1 + } elseif { $gcov_args == "" } { + set gcov_args $a + } else { + switch [dg-process-target $a] { + "N" { return } + "F" { set xfailed 1 } + } } } # Extract the test name from the arguments. set testcase [lindex $gcov_args end] - if { $gcov_execute_xfail != "" } { - eval setup_xfail [split $gcov_execute_xfail] - } - verbose "Running $GCOV $testcase" 2 set testcase [remote_download host $testcase] set result [remote_exec host $GCOV $gcov_args] if { [lindex $result 0] != 0 } { + if { $xfailed } { + setup_xfail "*-*-*" + } fail "$subdir/$testcase gcov failed: [lindex $result 1]" clean-gcov $testcase return @@ -264,16 +277,15 @@ proc run-gcov { args } { # Get the gcov output file after making sure it exists. set files [glob -nocomplain $testcase.gcov] if { $files == "" } { + if { $xfailed } { + setup_xfail "*-*-*" + } fail "$subdir/$testcase gcov failed: $testcase.gcov does not exist" clean-gcov $testcase return } remote_upload host $testcase.gcov $testcase.gcov - if { $gcov_verify_xfail != "" } { - eval setup_xfail [split $gcov_verify_xfail] - } - # Check that line execution counts are as expected. set lfailed [verify-lines $testcase $testcase.gcov] @@ -293,6 +305,9 @@ proc run-gcov { args } { # Report whether the gcov test passed or failed. If there were # multiple failures then the message is a summary. set tfailed [expr $lfailed + $bfailed + $cfailed] + if { $xfailed } { + setup_xfail "*-*-*" + } if { $tfailed > 0 } { fail "$subdir/$testcase gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cfailed in return percentages" } else {