From patchwork Thu May 11 13:10:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 761066 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wNtlN2zD8z9s2G for ; Thu, 11 May 2017 23:10:56 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tG+Jm4rj"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=L6NYi5PmrauQ2sWYH 0G0+apR87mXq1ISlQohhgLvMQkGjCbTsa3EnGNZsYhLAZWoU+Sx4LexMVr02gAPM Mv9w1GuosV/eE+kTDYAuoJ0e6TRoPS2vFSWpE3D01Bn4gayuhkA4R4qdTM8m6fUJ kVSEc7GAmG1Ogi8++n0zUhhheY= 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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=GU8N4wefhFZWeL8Iw1ILy4J QjUk=; b=tG+Jm4rj/fr/FG5mwnyrYx9BBVZI11gQ6F85MY2VvOTS1vK5rzhcpKW +nZ/Du8XKs0UDUfob/kHKerTpvm4YijdUPRIp7CQqUyTdaoN4asuw63dK70+fXyG JUewFX5TzPizKylUt2DSaHrZN9VzWNJNS/L9vLaZ17Md18wOj42o= Received: (qmail 69361 invoked by alias); 11 May 2017 13:10:40 -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 69244 invoked by uid 89); 11 May 2017 13:10:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-yb0-f169.google.com Received: from mail-yb0-f169.google.com (HELO mail-yb0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 May 2017 13:10:38 +0000 Received: by mail-yb0-f169.google.com with SMTP id 8so6250399ybw.1 for ; Thu, 11 May 2017 06:10:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=8qspooPwr4EooKgnDRRjSI33na8JeS7uCrXAEJvNwAE=; b=OXp/6zK4qf3DyJF2bPGf/zB0rgA0iRap/pxZjfcEFqB9D94BvVa1BGWxG/vFUO3Pjr N851489dDDhKWwtUnnk5aWDoxos1meQvTQNEDUnLvhkqw3p/420PnAqDO3SVSHvtYu9y Be1k2eDn68ufGl5axGRBEo0K1hS3ELxNRyIhDU/6/Ifs6cswGCRvAF53LOZsXCuDEYfS XerC3Otjxf8Ti9+nv3vAkbFaJDcXsvnA01q5JSmy4MeonAV5+lgi5/+iAV9AL53Q5TyU jjXUy9yZQb75cfQnxaXTwx0gXpeEfbUFAWbsgYD6xwUZs4TRuuHG1Y62fEw47wAHrRFh JSPg== X-Gm-Message-State: AODbwcBDABuI5axC8mQQEObdRWEjUWlJwiAdr4ZTFdTfgLRMAlcj85v1 oXgk7q0tdvUWsA== X-Received: by 10.37.177.30 with SMTP id g30mr219214ybj.118.1494508239168; Thu, 11 May 2017 06:10:39 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:f6d0:5ac5:64cd:f102? ([2620:10d:c091:200::7:4a1a]) by smtp.googlemail.com with ESMTPSA id s129sm65307ywg.11.2017.05.11.06.10.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 06:10:38 -0700 (PDT) Subject: Re: [PATCH] make RTL/TREE/IPA dump kind an index To: Rainer Orth Cc: Richard Biener , GCC Patches References: <9eb0ff26-4b3a-a1ab-c0ae-6e39639ab179@acm.org> <6fb48593-224d-fee9-3089-36d519b493c9@acm.org> From: Nathan Sidwell Message-ID: <863cd7b1-8ab9-7621-4719-2b9c38fdb282@acm.org> Date: Thu, 11 May 2017 09:10:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: On 05/11/2017 08:28 AM, Rainer Orth wrote: > On the gcc-7 branch, the dump file (from -fdump-class-hierarchy) was > called covariant7.C.002t.class, now it's covariant7.C.002l.class. But > gcc/testsuite/lib/scantree.exp (scan-tree-dump) expects the NNNt. > form. fixed thusly, applied as obvious. the scan$foo.exp files look like they could benefit from a higher-level scandump.exp interface, but that's a cleanup for another day. nathan 2017-05-11 Nathan Sidwell * lib/scanlang.exp: New. * lib/gcc-dg.exp: Load scanlang.exp. * g++.dg/inherit/covariant7.C: Use scan-lang-dump. Index: g++.dg/inherit/covariant7.C =================================================================== --- g++.dg/inherit/covariant7.C (revision 247902) +++ g++.dg/inherit/covariant7.C (working copy) @@ -36,15 +36,15 @@ struct c6 : c0, c3, c4 // f2 appears four times in the c6 vtables: // once in c1-in-c3-in-c6 - covariant, virtual base, uses c1 vcall offset and c0 vbase offset -// { dg-final { scan-tree-dump "24 .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "48 .*c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } } +// { dg-final { scan-lang-dump "24 .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev" "class" { target ilp32 } } } +// { dg-final { scan-lang-dump "48 .*c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } } // once in c3-in-c6 - non-covariant, non-virtual base, calls f2 directly -// { dg-final { scan-tree-dump "28 .*c6::f2" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "56 .*c6::f2" "class" { target lp64 } } } +// { dg-final { scan-lang-dump "28 .*c6::f2" "class" { target ilp32 } } } +// { dg-final { scan-lang-dump "56 .*c6::f2" "class" { target lp64 } } } // once in c1-in-c3-in-c4-in-c6 - lost primary -// { dg-final { scan-tree-dump "80 .*0" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "160 .*0" "class" { target lp64 } } } +// { dg-final { scan-lang-dump "80 .*0" "class" { target ilp32 } } } +// { dg-final { scan-lang-dump "160 .*0" "class" { target lp64 } } } // once in c3-in-c4-in-c6 - c3 vcall offset -// { dg-final { scan-tree-dump "84 .*c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "168 .*c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } } +// { dg-final { scan-lang-dump "84 .*c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } } +// { dg-final { scan-lang-dump "168 .*c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } } Index: lib/gcc-dg.exp =================================================================== --- lib/gcc-dg.exp (revision 247902) +++ lib/gcc-dg.exp (working copy) @@ -22,6 +22,7 @@ load_lib scanasm.exp load_lib scanrtl.exp load_lib scantree.exp load_lib scanipa.exp +load_lib scanlang.exp load_lib timeout.exp load_lib timeout-dg.exp load_lib prune.exp Index: lib/scanlang.exp =================================================================== --- lib/scanlang.exp (revision 0) +++ lib/scanlang.exp (working copy) @@ -0,0 +1,43 @@ +# Copyright (C) 2000-2017 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Various utilities for scanning tree dump output, used by gcc-dg.exp and +# g++-dg.exp. + +load_lib scandump.exp + +# Utility for scanning compiler result, invoked via dg-final. +# Call pass if pattern is present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped lang pass +# Argument 2 handles expected failures and the like +proc scan-lang-dump { args } { + + if { [llength $args] < 2 } { + error "scan-tree-dump: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-tree-dump: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump "lang" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" [lindex $args 2] + } else { + scan-dump "lang" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" + } +}