From patchwork Sat Sep 4 20:08:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 63804 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 2F8DCB7126 for ; Sun, 5 Sep 2010 06:08:52 +1000 (EST) Received: (qmail 28779 invoked by alias); 4 Sep 2010 20:08:48 -0000 Received: (qmail 28760 invoked by uid 22791); 4 Sep 2010 20:08:40 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Sep 2010 20:08:30 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 6F5121C006A2 for ; Sat, 4 Sep 2010 22:08:27 +0200 (CEST) Received: from igel.home (ppp-88-217-121-86.dynamic.mnet-online.de [88.217.121.86]) by mail.mnet-online.de (Postfix) with ESMTP id 0E2701C001B3 for ; Sat, 4 Sep 2010 22:08:27 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id B8465CA299; Sat, 4 Sep 2010 22:08:26 +0200 (CEST) From: Andreas Schwab To: gcc-patches@gcc.gnu.org Subject: Replace ".*" by "\[^\n\]*" in tcl regexps X-Yow: .. Now I think I just reached the state of HYPERTENSION that comes JUST BEFORE you see the TOTAL at the SAFEWAY CHECKOUT COUNTER! Date: Sat, 04 Sep 2010 22:08:26 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 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 In tcl "." matches newline, so use "\[^\n\]" instead so that the regexps don't match multiple lines. Tested on powerpc-linux and checked in as obvious. Andreas. 2010-09-04 Andreas Schwab * g++.dg/debug/dwarf2/global-used-types-1.C: Replace ".*" by "\[^\n\]*". * g++.dg/debug/dwarf2/namespace-1.C: Likewise. * g++.dg/debug/dwarf2/pubnames-1.C: Likewise. * g++.dg/debug/dwarf2/template-func-params-4.C: Likewise. * g++.dg/debug/dwarf2/template-func-params-7.C: Likewise. * g++.dg/debug/dwarf2/template-params-4.C: Likewise. * g++.dg/debug/dwarf2/template-params-6.C: Likewise. * g++.dg/debug/dwarf2/template-params-7.C: Likewise. * g++.dg/debug/dwarf2/typedef1.C: Likewise. * gcc.dg/debug/dwarf2/global-used-types.c: Likewise. * gcc.dg/debug/dwarf2/inline2.c: Likewise. * gcc.target/i386/pr22152.c: Likewise. * gcc.target/i386/pr36992-1.c: Likewise. * gcc.target/i386/pr36992-2.c: Likewise. * gcc.target/sh/sh4a-memmovua.c: Likewise. Index: gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/global-used-types-1.C (working copy) @@ -1,10 +1,10 @@ // Contributed by Dodji Seketeli // { dg-options "-g -dA -fno-merge-debug-strings" } // { dg-do compile } -// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumeration_type" 1 } } -// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumerator" 2 } } -// { dg-final { scan-assembler-times "ascii \"a.0\"\[\t \]+.*?DW_AT_name" 1 } } -// { dg-final { scan-assembler-times "ascii \"b.0\"\[\t \]+.*?DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_enumeration_type" 1 } } +// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_enumerator" 2 } } +// { dg-final { scan-assembler-times "ascii \"a.0\"\[\t \]+\[^\n\]*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "ascii \"b.0\"\[\t \]+\[^\n\]*DW_AT_name" 1 } } struct foo { Index: gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/namespace-1.C (working copy) @@ -5,10 +5,10 @@ // We want to test that there is a DW_TAG_namespace DIE DW_AT_name is set // to "not_emitted". That namespace die has a child DW_TAG_typedef DIE // which DW_AT_name is the null terminated string "T". -// { dg-final { scan-assembler-times "DIE +\\(.*?\\) DW_TAG_namespace" 1 } } -// { dg-final { scan-assembler-times "\"not_emitted.0\".*?DW_AT_name" 1 } } -// { dg-final { scan-assembler-times "DIE +\\(.*?\\) DW_TAG_typedef" 1 } } -// { dg-final { scan-assembler-times "\.ascii \"T.0\"\[\t \]+.*?DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DIE +\\(\[^\n\]*\\) DW_TAG_namespace" 1 } } +// { dg-final { scan-assembler-times "\"not_emitted.0\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DIE +\\(\[^\n\]*\\) DW_TAG_typedef" 1 } } +// { dg-final { scan-assembler-times "\.ascii \"T.0\"\[\t \]+\[^\n\]*DW_AT_name" 1 } } struct strukt { Index: gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C (working copy) @@ -8,13 +8,13 @@ // debug_pubnames section. The assembly code of that label adds an occurence // of section declaration assembly. So on Darwin, we need to check for two // occurences of the debug_pubnames section declaration. -// { dg-final { scan-assembler-times "\.section\[\t \].*?debug_pubnames" 1 { target { ! *-*-darwin* } } } } -// { dg-final { scan-assembler-times "\.section\[\t \].*?debug_pubnames" 2 { target { *-*-darwin* } } } } +// { dg-final { scan-assembler-times "\.section\[\t \]\[^\n\]*debug_pubnames" 1 { target { ! *-*-darwin* } } } } +// { dg-final { scan-assembler-times "\.section\[\t \]\[^\n\]*debug_pubnames" 2 { target { *-*-darwin* } } } } // // Then check of the presence of the names we are interested in. -// { dg-final { scan-assembler-times "\"main.0\".*external name" 1 } } -// { dg-final { scan-assembler-times "\"ns::ns_x.*external name" 1 } } -// { dg-final { scan-assembler-times "\"y::y_x.*external name" 1 } } +// { dg-final { scan-assembler-times "\"main.0\"\[^\n\]*external name" 1 } } +// { dg-final { scan-assembler-times "\"ns::ns_x\[^\n\]*external name" 1 } } +// { dg-final { scan-assembler-times "\"y::y_x\[^\n\]*external name" 1 } } namespace ns { int ns_x; } class y { public: static int y_x; }; Index: gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C (working copy) @@ -9,8 +9,8 @@ // DW_TAG_GNU_template_parameter_pack DIE, but in practise, there is only one // DW_TAG_GNU_template_parameter_pack as there is only count // is emitted. -// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_GNU_template_parameter_pack" 1} } -// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_type_param" 3} } +// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_GNU_template_parameter_pack" 1} } +// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_template_type_param" 3} } template struct count; Index: gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C (working copy) @@ -6,23 +6,23 @@ // There must be 5 subprograms generated: // printf(const char*), printf, // printf, printf and foo(). -// { dg-final {scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_subprogram" 5 } } +// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_subprogram" 5 } } // That makes 6 template type parameters. -// { dg-final {scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_type_param" 6 } } -// { dg-final {scan-assembler-times "\"printf.0\".*?DW_AT_name" 1 } } -// { dg-final {scan-assembler-times "\"printf.0\".*?DW_AT_name" 1 } } -// { dg-final {scan-assembler-times "\"printf.0\".*?DW_AT_name" 1 } } -// { dg-final {scan-assembler-times "\"printf.0\".*?DW_AT_name" 1 } } +// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_template_type_param" 6 } } +// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } } // printf and printf have a pack expansion as // function parameters. There should then be 3 // DW_TAG_GNU_template_parameter_pack and 3 DW_TAG_GNU_formal_parameter_pack DIEs -// { dg-final {scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_GNU_template_parameter_pack" 3 } } -// { dg-final {scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_GNU_formal_parameter_pack" 3 } } +// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_GNU_template_parameter_pack" 3 } } +// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_GNU_formal_parameter_pack" 3 } } // These 3 function template instantiations has a total of 3 template // parameters named T. -// { dg_final {scan-assembler-times "\.ascii \"T.0\"\[\t \]+.*?DW_AT_name" 3 } } +// { dg_final {scan-assembler-times "\.ascii \"T.0\"\[\t \]+\[^\n\]*DW_AT_name" 3 } } void Index: gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C (working copy) @@ -9,8 +9,8 @@ // DW_TAG_GNU_template_parameter_pack DIE, but in practise, there is only one // DW_TAG_GNU_template_parameter_pack as there is only count // is emitted. -// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_GNU_template_parameter_pack" 1} } -// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_template_type_param" 3} } +// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_GNU_template_parameter_pack" 1} } +// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_template_type_param" 3} } template struct count; Index: gcc/testsuite/g++.dg/debug/dwarf2/template-params-6.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/template-params-6.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/template-params-6.C (working copy) @@ -2,8 +2,8 @@ // Origin PR debug/30161 // { dg-options "-g -dA -fno-merge-debug-strings" } // { dg-final { scan-assembler-times "DW_TAG_GNU_template_template_param" 2 } } -// { dg-final { scan-assembler-times "\"vector.0\".*?DW_AT_GNU_template_name" 1 } } -// { dg-final { scan-assembler-times ".ascii \"U.0\".*?DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "\"vector.0\"\[^\n\]*DW_AT_GNU_template_name" 1 } } +// { dg-final { scan-assembler-times ".ascii \"U.0\"\[^\n\]*DW_AT_name" 1 } } template struct vector_base Index: gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C (working copy) @@ -5,7 +5,7 @@ // The type M<> should have one DW_TAG_GNU_template_parameter_pack DIE, // with no DW_AT_name attribute. We don't test the fact that it has no // DW_AT_name though. -// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_GNU_template_parameter_pack" 1 } } +// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_GNU_template_parameter_pack" 1 } } template Index: gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C (revision 163867) +++ gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C (working copy) @@ -3,12 +3,12 @@ // { dg-options "-g -dA" } // { dg-do compile } // { dg-final { scan-assembler-times "DW_TAG_structure_type" 2 } } -// { dg-final { scan-assembler-times "DW_AT_name: \"foo<1u>\"|\"foo<1u>..\".*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DW_AT_name: \"foo<1u>\"|\"foo<1u>..\"\[^\n\]*DW_AT_name" 1 } } // { dg-final { scan-assembler-times "DW_TAG_enumeration_type" 2 } } -// { dg-final { scan-assembler-times "DW_AT_name: \"typedef foo<1u>::type type\"|\"typedef foo<1u>::type type..\".*DW_AT_name" 1 } } -// { dg-final { scan-assembler-times "DIE (.*) DW_TAG_enumeration_type" 2 } } -// { dg-final { scan-assembler-times "\"e0..\".*DW_AT_name" 1 } } -// { dg-final { scan-assembler-times "\"e1..\".*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DW_AT_name: \"typedef foo<1u>::type type\"|\"typedef foo<1u>::type type..\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_enumeration_type" 2 } } +// { dg-final { scan-assembler-times "\"e0..\"\[^\n\]*DW_AT_name" 1 } } +// { dg-final { scan-assembler-times "\"e1..\"\[^\n\]*DW_AT_name" 1 } } template struct foo Index: gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c =================================================================== --- gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c (revision 163867) +++ gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c (working copy) @@ -2,10 +2,10 @@ Contributed by Dodji Seketeli { dg-options "-g -dA -fno-merge-debug-strings" } { dg-do compile } - { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumeration_type" 1 } } - { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_enumerator" 2 } } - { dg-final { scan-assembler-times "ascii \"a.0\"\[\t \]+.*?DW_AT_name" 1 } } - { dg-final { scan-assembler-times "ascii \"b.0\"\[\t \]+.*?DW_AT_name" 1 } } + { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_enumeration_type" 1 } } + { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_enumerator" 2 } } + { dg-final { scan-assembler-times "ascii \"a.0\"\[\t \]+\[^\n\]*DW_AT_name" 1 } } + { dg-final { scan-assembler-times "ascii \"b.0\"\[\t \]+\[^\n\]*DW_AT_name" 1 } } */ enum { a, b }; Index: gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c =================================================================== --- gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c (revision 163867) +++ gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c (working copy) @@ -21,14 +21,14 @@ - One for each subroutine inlined into main, that's 3. - One for earch subroutine inline into the out of line instances of third, second and first. */ -/* { dg-final { scan-assembler-times "\\(DIE \\(.*?\\) DW_TAG_inlined_subroutine" 6 } } */ +/* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) DW_TAG_inlined_subroutine" 6 } } */ /* Likewise we should have 6 DW_TAG_lexical_block DIEs: - One for each subroutine inlined into main, so that's 3. - One for each subroutine inlined in the out of line instances of third, second and first, that's 3. */ -/* { dg-final { scan-assembler-times "\\(DIE \\(.*?\\) DW_TAG_lexical_block" 6 } } */ +/* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) DW_TAG_lexical_block" 6 } } */ /* There are 3 DW_AT_inline attributes: one per abstract inline instance. Index: gcc/testsuite/gcc.target/i386/pr22152.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr22152.c (revision 163867) +++ gcc/testsuite/gcc.target/i386/pr22152.c (working copy) @@ -15,4 +15,4 @@ unsigned_add3 (const __m64 * a, const __ return sum; } -/* { dg-final { scan-assembler-times "movq\[ \\t\]+.*%mm" 1 } } */ +/* { dg-final { scan-assembler-times "movq\[ \\t\]+\[^\n\]*%mm" 1 } } */ Index: gcc/testsuite/gcc.target/i386/pr36992-1.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr36992-1.c (revision 163867) +++ gcc/testsuite/gcc.target/i386/pr36992-1.c (working copy) @@ -9,4 +9,4 @@ test (__m128i b) return _mm_move_epi64 (b); } -/* { dg-final { scan-assembler-times "movq\[ \\t\]+.*%xmm" 1 } } */ +/* { dg-final { scan-assembler-times "movq\[ \\t\]+\[^\n\]*%xmm" 1 } } */ Index: gcc/testsuite/gcc.target/i386/pr36992-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr36992-2.c (revision 163867) +++ gcc/testsuite/gcc.target/i386/pr36992-2.c (working copy) @@ -9,4 +9,4 @@ test (__m128i b) return _mm_move_epi64 (b); } -/* { dg-final { scan-assembler-times "movq\[ \\t\]+.*%xmm" 1 } } */ +/* { dg-final { scan-assembler-times "movq\[ \\t\]+\[^\n\]*%xmm" 1 } } */ Index: gcc/testsuite/gcc.target/sh/sh4a-memmovua.c =================================================================== --- gcc/testsuite/gcc.target/sh/sh4a-memmovua.c (revision 163867) +++ gcc/testsuite/gcc.target/sh/sh4a-memmovua.c (working copy) @@ -2,7 +2,7 @@ 32-bit-aligned addresses. */ /* { dg-do compile { target "sh*-*-*" } } */ /* { dg-options "-O" } */ -/* { dg-final { scan-assembler-times "\tmovua\\.l\t(.*)+" 2 } } */ +/* { dg-final { scan-assembler-times "\tmovua\\.l\t" 2 } } */ #ifdef __SH4A__ #include