From patchwork Thu Apr 27 08:43:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 755893 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 3wD9VD5MSvz9s7l for ; Thu, 27 Apr 2017 18:44:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="MVngx/4O"; 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:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=fugxWE1I+lrF/mVhb LXx79bePgI8EdbUJddYnkYRLNBIqaIxA6eS9t+OUWEYEeVFpXHRIi/x5fkPWzM3A ML6tJljw9o9Q5OL9KmY/3ACNK0ZG+atkDddBQc9M1uh+8aGGH6Q/9Tnc1Gw7sRZd Rvlsn6TgQI8sUQk0crNpB3np/Q= 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:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=6MPJZntenjV+MikpSnxT133 2UDo=; b=MVngx/4OCIXw9EMsfgkt1Yx5cQ//tFNY+EPiu1at/gO0Q3fI2rnbL0K iAIKaLm2NDtX4SQf5sSaU4izTfl5GppwiqjFUBKXEAAS/IGpOVOErL83Hh5GsV2p 74bHjbhGKAvRVFp9xyr21bWzbCLNtD+29Gzm+o9c+guyolSzu7DI= Received: (qmail 84833 invoked by alias); 27 Apr 2017 08:44:07 -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 83843 invoked by uid 89); 27 Apr 2017 08:44:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=referring X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Apr 2017 08:43:59 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1d3f1o-0002FF-FU from Tom_deVries@mentor.com ; Thu, 27 Apr 2017 01:43:57 -0700 Received: from [127.0.0.1] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 27 Apr 2017 09:43:50 +0100 Subject: Re: [testsuite] Add missing dg-require-effective-target alloca to gcc testsuite To: Jakub Jelinek References: <336349f0-b973-77c0-c5f5-710240312270@mentor.com> <587C88D3-2CEA-4E54-899E-ADFE8FBB6DC4@comcast.net> <20170426115738.GP1809@tucnak> CC: Mike Stump , Rainer Orth , Richard Biener , GCC Patches From: Tom de Vries Message-ID: <851c6adc-56bc-ceb2-0744-99c606440c98@mentor.com> Date: Thu, 27 Apr 2017 10:43:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170426115738.GP1809@tucnak> X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) On 04/26/2017 01:57 PM, Jakub Jelinek wrote: > On Wed, Apr 26, 2017 at 01:48:03PM +0200, Tom de Vries wrote: >> [ reposting with patch removed, was too big for gcc-patches@ ] > > I see in various tests you've ended up with ... { target ... } . } > I think it would be better to just use ... { target ... } } > in that case, . is the default, and if target is *-*-*, also remove the { > target ... }. > I've written sed commands for both simplifications, untested patches attached. [ I suppose we could drop an empty comment as the last argument as well. { ... "" }. ] > Are there any spots where the relative line number is with too big bias > (say .+10 or .-10 and more)? In the original patch, which rewrote all absolute line numbers, yes, it generated -62 ( and Mike commented on that here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80221#c6 ). In the committed patch, no. The greatest relative line number magnitude was 6. The script was limited to rewrite only dg directives with -1 .. +1 relative line number, and adjacent directives referring to the same line. Thanks, - Tom > I guess those should be decided case by case > whether we want relative, absolute or saved line numbers. If the > diagnostic is within the same function or code block as the stuff it is > relative to, relative is fine, but if e.g. the messages are just at the end > of file and there are unrelated functions in between, it is not a good idea > to use relative. > > Jakub > Remove '{ target *-*-* } }' in dg-(error|warning|message|bogus) find $(find -type d -name testsuite) -type f \ | xargs sed -ri \ 's#(dg-(error|warning|message|bogus).*) \{ target \*-\*-\* \} \}#\1 }#' --- gcc/testsuite/g++.dg/parse/error2.C | 2 +- gcc/testsuite/g++.dg/parse/parameter-declaration-1.C | 2 +- gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C | 2 +- gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c | 2 +- gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c | 2 +- gcc/testsuite/gcc.dg/cpp/19990413-1.c | 2 +- gcc/testsuite/gcc.dg/dg-test-1.c | 4 ++-- gcc/testsuite/gcc.dg/empty-source-2.c | 2 +- gcc/testsuite/gcc.dg/empty-source-3.c | 2 +- gcc/testsuite/gcc.dg/format/c99-printf-1.c | 4 ++-- gcc/testsuite/gcc.dg/format/c99-scanf-1.c | 2 +- gcc/testsuite/gcc.dg/label-decl-2.c | 2 +- gcc/testsuite/gcc.dg/m-un-2.c | 2 +- gcc/testsuite/gcc.dg/uninit-pr20644-O0.c | 2 +- gcc/testsuite/gfortran.dg/pr70006.f90 | 8 ++++---- gcc/testsuite/obj-c++.dg/fsf-package-0.m | 2 +- .../testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc | 2 +- 17 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gcc/testsuite/g++.dg/parse/error2.C b/gcc/testsuite/g++.dg/parse/error2.C index cb8f413..1cca27c 100644 --- a/gcc/testsuite/g++.dg/parse/error2.C +++ b/gcc/testsuite/g++.dg/parse/error2.C @@ -8,7 +8,7 @@ int func(double); template struct Foo {}; -Foo f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "func double" { target *-*-* } } +Foo f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "func double" } // { dg-error "10:'g' cannot appear in a constant-expression" "g" { target *-*-* } .-1 } // { dg-error "11:a function call cannot appear in a constant-expression" "call" { target *-*-* } .-2 } // { dg-error "12:template argument 1 is invalid" "invalid template argument" { target *-*-* } .-3 } diff --git a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C index 22d6f21..1eaa00e 100644 --- a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C +++ b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C @@ -3,4 +3,4 @@ // { dg-do compile } struct { - a(void = 0; a(0), a(0) // { dg-error "" "" { target *-*-* } } + a(void = 0; a(0), a(0) // { dg-error "" "" } diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C index 9027061..d298555 100644 --- a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C +++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C @@ -4,7 +4,7 @@ int foo() { int x; - float& q = reinterpret_cast (x); /* { dg-message "dereferencing type-punned" "deref" { target *-*-* } } */ + float& q = reinterpret_cast (x); /* { dg-message "dereferencing type-punned" "deref" } */ q = 1.0; /* { dg-warning "does break strict-aliasing" "strict-aliasing" { xfail *-*-* } } */ return x; } diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c index d29df30..843885f 100644 --- a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c @@ -2,7 +2,7 @@ /* { dg-options "-Wall" } */ -void foo(unsigned long* ulp); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } } */ +void foo(unsigned long* ulp); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */ void bar(long* lp) { diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c index aebfbdd..ab1130d 100644 --- a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c @@ -2,7 +2,7 @@ /* { dg-options "-pedantic" } */ -void foo(unsigned long* ulp);/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } } */ +void foo(unsigned long* ulp);/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" } */ void bar(long* lp) { foo(lp); /* { dg-warning "differ in signedness" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/19990413-1.c b/gcc/testsuite/gcc.dg/cpp/19990413-1.c index bcb7e52..00f62c8 100644 --- a/gcc/testsuite/gcc.dg/cpp/19990413-1.c +++ b/gcc/testsuite/gcc.dg/cpp/19990413-1.c @@ -9,5 +9,5 @@ func(void) { FOO(i = 4) - else; /* { dg-error "'else' without a previous 'if'" "error on this line" { target *-*-* } } */ + else; /* { dg-error "'else' without a previous 'if'" "error on this line" } */ } diff --git a/gcc/testsuite/gcc.dg/dg-test-1.c b/gcc/testsuite/gcc.dg/dg-test-1.c index b4e22e2..c0e672a 100644 --- a/gcc/testsuite/gcc.dg/dg-test-1.c +++ b/gcc/testsuite/gcc.dg/dg-test-1.c @@ -5,7 +5,7 @@ void foo (void) { /* { dg-error "'a' undeclared" "err1" { target *-*-* } .+1 } */ - int z = a + b + c + d;/* { dg-error "'b' undeclared" "err2" { target *-*-* } } */ + int z = a + b + c + d;/* { dg-error "'b' undeclared" "err2" } */ } /* { dg-error "'c' undeclared" "err3" { target *-*-* } .-1 } */ @@ -13,7 +13,7 @@ foo (void) /* { dg-warning "unused parameter 'e'" "warn1" { target *-*-* } .+3 } */ void /* { dg-warning "unused parameter 'f'" "warn2" { target *-*-* } .+1 } */ -bar (int e, int f, int g, int h)/* { dg-warning "unused parameter 'g'" "warn3" { target *-*-* } } */ +bar (int e, int f, int g, int h)/* { dg-warning "unused parameter 'g'" "warn3" } */ { /* { dg-warning "unused parameter 'h'" "warn4" { target *-*-* } .-1 } */ } diff --git a/gcc/testsuite/gcc.dg/empty-source-2.c b/gcc/testsuite/gcc.dg/empty-source-2.c index e0f1e20..ae36159 100644 --- a/gcc/testsuite/gcc.dg/empty-source-2.c +++ b/gcc/testsuite/gcc.dg/empty-source-2.c @@ -3,4 +3,4 @@ /* { dg-do compile } */ /* { dg-options "-pedantic" } */ -/* { dg-warning "ISO C forbids an empty translation unit" "empty" { target *-*-* } } */ +/* { dg-warning "ISO C forbids an empty translation unit" "empty" } */ diff --git a/gcc/testsuite/gcc.dg/empty-source-3.c b/gcc/testsuite/gcc.dg/empty-source-3.c index a1e1d2c..bcd76ac 100644 --- a/gcc/testsuite/gcc.dg/empty-source-3.c +++ b/gcc/testsuite/gcc.dg/empty-source-3.c @@ -4,4 +4,4 @@ /* { dg-do compile } */ /* { dg-options "-pedantic-errors" } */ -/* { dg-error "ISO C forbids an empty translation unit" "empty" { target *-*-* } } */ +/* { dg-error "ISO C forbids an empty translation unit" "empty" } */ diff --git a/gcc/testsuite/gcc.dg/format/c99-printf-1.c b/gcc/testsuite/gcc.dg/format/c99-printf-1.c index 729e41c..408ad49 100644 --- a/gcc/testsuite/gcc.dg/format/c99-printf-1.c +++ b/gcc/testsuite/gcc.dg/format/c99-printf-1.c @@ -62,8 +62,8 @@ foo (int i, unsigned int u, double d, char *s, void *p, int *n, printf ("%llc", i); /* { dg-warning "length" "bad use of %ll" } */ printf ("%lls", s); /* { dg-warning "length" "bad use of %ll" } */ printf ("%llp", p); /* { dg-warning "length" "bad use of %ll" } */ - printf ("%jd%ji%jo%ju%jx%jX", j, j, uj, uj, uj, uj); /* { dg-bogus "length" "bogus %j warning" { target *-*-* } } */ - printf ("%jn", jn); /* { dg-bogus "length" "bogus %j warning" { target *-*-* } } */ + printf ("%jd%ji%jo%ju%jx%jX", j, j, uj, uj, uj, uj); /* { dg-bogus "length" "bogus %j warning" } */ + printf ("%jn", jn); /* { dg-bogus "length" "bogus %j warning" } */ printf ("%jf", d); /* { dg-warning "length" "bad use of %j" } */ printf ("%jF", d); /* { dg-warning "length" "bad use of %j" } */ printf ("%je", d); /* { dg-warning "length" "bad use of %j" } */ diff --git a/gcc/testsuite/gcc.dg/format/c99-scanf-1.c b/gcc/testsuite/gcc.dg/format/c99-scanf-1.c index 7a8b3e2..521ef1d 100644 --- a/gcc/testsuite/gcc.dg/format/c99-scanf-1.c +++ b/gcc/testsuite/gcc.dg/format/c99-scanf-1.c @@ -82,7 +82,7 @@ foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp, scanf ("%ll[ac]", s); /* { dg-warning "length" "bad use of %ll" } */ scanf ("%llc", s); /* { dg-warning "length" "bad use of %ll" } */ scanf ("%llp", pp); /* { dg-warning "length" "bad use of %ll" } */ - scanf ("%jd%ji%jo%ju%jx%jX%jn", jp, jp, ujp, ujp, ujp, ujp, jn); /* { dg-bogus "length" "bogus %j warning" { target *-*-* } } */ + scanf ("%jd%ji%jo%ju%jx%jX%jn", jp, jp, ujp, ujp, ujp, ujp, jn); /* { dg-bogus "length" "bogus %j warning" } */ scanf ("%ja", fp); /* { dg-warning "length" "bad use of %j" } */ scanf ("%jA", fp); /* { dg-warning "length" "bad use of %j" } */ scanf ("%je", fp); /* { dg-warning "length" "bad use of %j" } */ diff --git a/gcc/testsuite/gcc.dg/label-decl-2.c b/gcc/testsuite/gcc.dg/label-decl-2.c index 2ad4272..3ebe290 100644 --- a/gcc/testsuite/gcc.dg/label-decl-2.c +++ b/gcc/testsuite/gcc.dg/label-decl-2.c @@ -8,7 +8,7 @@ typedef int b; void f (void) { - __label__ a, b, c, d; /* { dg-warning "ISO C forbids label declarations" "label decls" { target *-*-* } } */ + __label__ a, b, c, d; /* { dg-warning "ISO C forbids label declarations" "label decls" } */ __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */ goto c; /* { dg-error "label 'c' used but not defined" } */ a: (void)0; diff --git a/gcc/testsuite/gcc.dg/m-un-2.c b/gcc/testsuite/gcc.dg/m-un-2.c index 345b9ff..b12c7cb 100644 --- a/gcc/testsuite/gcc.dg/m-un-2.c +++ b/gcc/testsuite/gcc.dg/m-un-2.c @@ -15,7 +15,7 @@ struct vtable { struct vtable mtable = { malloc, free -}; /* { dg-warning "missing initializer" "warning regression" { target *-*-* } } */ +}; /* { dg-warning "missing initializer" "warning regression" } */ /* { dg-message "declared here" "warning regression 2" { target *-*-* } 12 } */ /* With designated initializers, we assume you meant to leave out the diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c index 14bd0e2..8ae697a 100644 --- a/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c +++ b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c @@ -18,7 +18,7 @@ int bar () int j; if (1 == i) - return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } } */ + return j; /* { dg-warning "uninitialized" "uninitialized" } */ return 0; } diff --git a/gcc/testsuite/gfortran.dg/pr70006.f90 b/gcc/testsuite/gfortran.dg/pr70006.f90 index a98d3da..97b4170 100644 --- a/gcc/testsuite/gfortran.dg/pr70006.f90 +++ b/gcc/testsuite/gfortran.dg/pr70006.f90 @@ -1,9 +1,9 @@ ! { dg-do compile } program test - print 1, 'string 1' ! { dg-error "FORMAT label 1" " " { target *-*-* } } - print 1, 'string 2' ! { dg-error "FORMAT label 1" " " { target *-*-* } } + print 1, 'string 1' ! { dg-error "FORMAT label 1" " " } + print 1, 'string 2' ! { dg-error "FORMAT label 1" " " } !1 format(a) - goto 2 ! { dg-error "Label 2 referenced" " " { target *-*-* } } - goto 2 ! { dg-error "Label 2 referenced" " " { target *-*-* } } + goto 2 ! { dg-error "Label 2 referenced" " " } + goto 2 ! { dg-error "Label 2 referenced" " " } !2 continue end program diff --git a/gcc/testsuite/obj-c++.dg/fsf-package-0.m b/gcc/testsuite/obj-c++.dg/fsf-package-0.m index c2fc0cf..942c1f4 100644 --- a/gcc/testsuite/obj-c++.dg/fsf-package-0.m +++ b/gcc/testsuite/obj-c++.dg/fsf-package-0.m @@ -32,5 +32,5 @@ void foo (void) a->v2 = 1; a->v3 = [a value] - a->v2; /* { dg-warning ".v3. is @protected" } */ a->v4 = a->v3 - 1; /* { dg-warning ".v4. is @private" } */ - /* { dg-warning ".v3. is @protected" "" { target *-*-* } } */ + /* { dg-warning ".v3. is @protected" "" } */ } diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc b/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc index 76999c4..c16ac6f 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc @@ -31,5 +31,5 @@ void foo() { - assert(true); // { dg-error "not declared" "" { target *-*-* } } + assert(true); // { dg-error "not declared" "" } }