From patchwork Fri May 26 09:30:25 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: 767342 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 3wZ18w72v5z9s74 for ; Fri, 26 May 2017 19:31:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FPmJk8Ch"; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=drhXB3jL0F4Q1cpzSfEHNTgmV6y58dYl2Lpjypx8hcD59lBETn 2xPiZPPaFvJr1KCqc5SJaWwEglWlgAjFaHGT66yPkdwy970++Q6pHQgC6GKHyu8K VK1uL896MWLcHZIs365mJDeARRlZb5g/VvCCSnXaJUOAQj1g14TZLfiCA= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=afee0rsPHmNXm6r1hAO5jg2eFzM=; b=FPmJk8ChrAOTgfznmepI 9LRqYxARWImFCjO6szn+DUHleNG0C4ySIwHxsB97FfshKQkaFvckjb2djAh6B6SW J8TkFGZiIh1iJTys2x+4qkGFvpc0U0IuaP9nUkqq3uaoBXC7Dy0qTefQiPWgrgwP 0/1S7LDT6x5fMin5tkiA/+g= Received: (qmail 130413 invoked by alias); 26 May 2017 09:30:57 -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 130392 invoked by uid 89); 26 May 2017 09:30:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 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, URIBL_RED autolearn=ham version=3.3.2 spammy=ok, lm, 78, Lm 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; Fri, 26 May 2017 09:30:47 +0000 Received: from svr-orw-mbx-06.mgc.mentorg.com ([147.34.90.206]) by relay1.mentorg.com with esmtp id 1dEBa4-0006Bx-Fb from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Fri, 26 May 2017 02:30:48 -0700 Received: from [127.0.0.1] (137.202.0.87) by SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 26 May 2017 02:30:43 -0700 To: GCC Patches From: Tom de Vries Subject: [testsuite, committed] Replace absolute line numbers in gcc.dg Message-ID: <0e7412b4-8399-2116-cea7-1150407be05d@mentor.com> Date: Fri, 26 May 2017 11:30:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) Hi, this patch replaces absolute line numbers in gcc.dg. Committed. Thanks, - Tom Replace absolute line numbers in gcc.dg 2017-05-24 Tom de Vries PR testsuite/80557 * gcc.dg/20011021-1.c: Replace absolute line numbers. * gcc.dg/Wcxx-compat-8.c: Same. * gcc.dg/Wobjsize-1.c: Same. * gcc.dg/Wshadow-local-2.c: Same. * gcc.dg/Wstrict-aliasing-converted-assigned.c: Same. * gcc.dg/anon-struct-6.c: Same. * gcc.dg/asm-wide-1.c: Same. * gcc.dg/builtin-inf-1.c: Same. * gcc.dg/builtin-redefine.c: Same. * gcc.dg/c90-array-lval-6.c: Same. * gcc.dg/c90-array-lval-7.c: Same. * gcc.dg/c90-fordecl-1.c: Same. * gcc.dg/c99-fordecl-2.c: Same. * gcc.dg/cast-lvalue-1.c: Same. * gcc.dg/cast-lvalue-2.c: Same. * gcc.dg/compound-lvalue-1.c: Same. * gcc.dg/cond-lvalue-1.c: Same. * gcc.dg/cpp/20000419-1.c: Same. * gcc.dg/cpp/backslash.c: Same. * gcc.dg/cpp/backslash2.c: Same. * gcc.dg/cpp/macspace1.c: Same. * gcc.dg/cpp/macspace2.c: Same. * gcc.dg/cpp/multiline-2.c: Same. * gcc.dg/cpp/pr27777.c: Same. * gcc.dg/cpp/pr30786.c: Same. * gcc.dg/cpp/pr34602.c: Same. * gcc.dg/cpp/redef1.c: Same. * gcc.dg/cpp/tr-warn1.c: Same. * gcc.dg/cpp/tr-warn3.c: Same. * gcc.dg/cpp/tr-warn6.c: Same. * gcc.dg/cpp/trad/hash.c: Same. * gcc.dg/cpp/trad/redef1.c: Same. * gcc.dg/cpp/ucs.c: Same. * gcc.dg/declspec-10.c: Same. * gcc.dg/declspec-11.c: Same. * gcc.dg/declspec-18.c: Same. * gcc.dg/format/c99-strftime-1.c: Same. * gcc.dg/format/ext-3.c: Same. * gcc.dg/format/pr72858.c: Same. * gcc.dg/gomp/appendix-a/a.24.1.c: Same. * gcc.dg/init-string-1.c: Same. * gcc.dg/label-decl-3.c: Same. * gcc.dg/m-un-2.c: Same. * gcc.dg/nofixed-point-2.c: Same. * gcc.dg/noncompile/20020213-1.c: Same. * gcc.dg/pch/counter-2.c: Same. * gcc.dg/plugin/diagnostic-test-string-literals-2.c: Same. * gcc.dg/pr27528.c: Same. * gcc.dg/pr27953.c: Same. * gcc.dg/pr35899.c: Same. * gcc.dg/pr37561.c: Same. * gcc.dg/pr45461.c: Same. * gcc.dg/pr45750.c: Same. * gcc.dg/pr53196-2.c: Same. * gcc.dg/pr53265.c: Same. * gcc.dg/redecl-1.c: Same. * gcc.dg/tls/thr-init-1.c: Same. * gcc.dg/torture/pr51106-1.c: Same. * gcc.dg/torture/pr51106-2.c: Same. * gcc.dg/uninit-19.c: Same. * gcc.dg/uninit-pr20644.c: Same. --- gcc/testsuite/gcc.dg/20011021-1.c | 4 +- gcc/testsuite/gcc.dg/Wcxx-compat-8.c | 3 +- gcc/testsuite/gcc.dg/Wobjsize-1.c | 3 +- gcc/testsuite/gcc.dg/Wshadow-local-2.c | 3 +- .../gcc.dg/Wstrict-aliasing-converted-assigned.c | 9 ++-- gcc/testsuite/gcc.dg/anon-struct-6.c | 4 +- gcc/testsuite/gcc.dg/asm-wide-1.c | 9 ++-- gcc/testsuite/gcc.dg/builtin-inf-1.c | 6 +-- gcc/testsuite/gcc.dg/builtin-redefine.c | 12 +++--- gcc/testsuite/gcc.dg/c90-array-lval-6.c | 2 +- gcc/testsuite/gcc.dg/c90-array-lval-7.c | 3 +- gcc/testsuite/gcc.dg/c90-fordecl-1.c | 4 +- gcc/testsuite/gcc.dg/c99-fordecl-2.c | 16 +++++--- gcc/testsuite/gcc.dg/cast-lvalue-1.c | 2 +- gcc/testsuite/gcc.dg/cast-lvalue-2.c | 2 +- gcc/testsuite/gcc.dg/compound-lvalue-1.c | 2 +- gcc/testsuite/gcc.dg/cond-lvalue-1.c | 2 +- gcc/testsuite/gcc.dg/cpp/20000419-1.c | 5 +-- gcc/testsuite/gcc.dg/cpp/backslash.c | 9 ++-- gcc/testsuite/gcc.dg/cpp/backslash2.c | 4 +- gcc/testsuite/gcc.dg/cpp/macspace1.c | 4 +- gcc/testsuite/gcc.dg/cpp/macspace2.c | 4 +- gcc/testsuite/gcc.dg/cpp/multiline-2.c | 5 +-- gcc/testsuite/gcc.dg/cpp/pr27777.c | 5 +-- gcc/testsuite/gcc.dg/cpp/pr30786.c | 5 +-- gcc/testsuite/gcc.dg/cpp/pr34602.c | 3 +- gcc/testsuite/gcc.dg/cpp/redef1.c | 19 ++++----- gcc/testsuite/gcc.dg/cpp/tr-warn1.c | 9 ++-- gcc/testsuite/gcc.dg/cpp/tr-warn3.c | 9 ++-- gcc/testsuite/gcc.dg/cpp/tr-warn6.c | 3 +- gcc/testsuite/gcc.dg/cpp/trad/hash.c | 5 +-- gcc/testsuite/gcc.dg/cpp/trad/redef1.c | 33 ++++++++------- gcc/testsuite/gcc.dg/cpp/ucs.c | 2 +- gcc/testsuite/gcc.dg/declspec-10.c | 7 ++-- gcc/testsuite/gcc.dg/declspec-11.c | 7 ++-- gcc/testsuite/gcc.dg/declspec-18.c | 44 ++++++++++++-------- gcc/testsuite/gcc.dg/format/c99-strftime-1.c | 4 +- gcc/testsuite/gcc.dg/format/ext-3.c | 48 ++++++++++++---------- gcc/testsuite/gcc.dg/format/pr72858.c | 8 ++-- gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c | 6 +-- gcc/testsuite/gcc.dg/init-string-1.c | 5 ++- gcc/testsuite/gcc.dg/label-decl-3.c | 2 +- gcc/testsuite/gcc.dg/m-un-2.c | 4 +- gcc/testsuite/gcc.dg/nofixed-point-2.c | 6 +-- gcc/testsuite/gcc.dg/noncompile/20020213-1.c | 27 ++++++++---- gcc/testsuite/gcc.dg/pch/counter-2.c | 2 +- .../plugin/diagnostic-test-string-literals-2.c | 2 +- gcc/testsuite/gcc.dg/pr27528.c | 13 ++++-- gcc/testsuite/gcc.dg/pr27953.c | 10 +++-- gcc/testsuite/gcc.dg/pr35899.c | 7 ++-- gcc/testsuite/gcc.dg/pr37561.c | 15 +++++-- gcc/testsuite/gcc.dg/pr45461.c | 6 ++- gcc/testsuite/gcc.dg/pr45750.c | 2 +- gcc/testsuite/gcc.dg/pr53196-2.c | 6 ++- gcc/testsuite/gcc.dg/pr53265.c | 5 ++- gcc/testsuite/gcc.dg/redecl-1.c | 5 ++- gcc/testsuite/gcc.dg/tls/thr-init-1.c | 7 ++-- gcc/testsuite/gcc.dg/torture/pr51106-1.c | 2 +- gcc/testsuite/gcc.dg/torture/pr51106-2.c | 2 +- gcc/testsuite/gcc.dg/uninit-19.c | 9 ++-- gcc/testsuite/gcc.dg/uninit-pr20644.c | 3 +- 61 files changed, 258 insertions(+), 216 deletions(-) diff --git a/gcc/testsuite/gcc.dg/20011021-1.c b/gcc/testsuite/gcc.dg/20011021-1.c index 8893b77..2d567a7 100644 --- a/gcc/testsuite/gcc.dg/20011021-1.c +++ b/gcc/testsuite/gcc.dg/20011021-1.c @@ -24,7 +24,7 @@ struct multilevel struct t t; union u u; union u v; - char *f; + char *f; /* { dg-line multilevel_f } */ }; struct t T0 = { 1 }; /* { dg-warning "missing init" } */ @@ -42,4 +42,4 @@ struct multilevel M = { .n = 9 }, /* { dg-bogus "initialization of union" } */ /* "string here" */ }; /* { dg-warning "missing init" } */ -/* { dg-message "declared here" "near init" { target *-*-* } 27 } */ +/* { dg-message "declared here" "near init" { target *-*-* } multilevel_f } */ diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-8.c b/gcc/testsuite/gcc.dg/Wcxx-compat-8.c index 85ccec7..9627dce 100644 --- a/gcc/testsuite/gcc.dg/Wcxx-compat-8.c +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-8.c @@ -63,6 +63,5 @@ void * f5 () { return &((struct t8) { }); /* { dg-warning "invalid in C\[+\]\[+\]" } */ + /* { dg-error "invalid use of undefined type" "" { target *-*-* } .-1 } */ } - -/* { dg-error "invalid use of undefined type" "" { target *-*-* } 65 } */ diff --git a/gcc/testsuite/gcc.dg/Wobjsize-1.c b/gcc/testsuite/gcc.dg/Wobjsize-1.c index 211e068..19c7e68 100644 --- a/gcc/testsuite/gcc.dg/Wobjsize-1.c +++ b/gcc/testsuite/gcc.dg/Wobjsize-1.c @@ -4,12 +4,13 @@ #include "Wobjsize-1.h" char buf[6]; +/* { dg-warning "writing" "" { target *-*-* } .-1 } */ + int main(int argc, char **argv) { strcpy (buf,"hello "); return 0; } -/* { dg-warning "writing" "" { target *-*-* } 6 } */ /* { dg-message "file included" "included" { target *-*-* } 0 } */ /* { dg-message "inlined from" "inlined" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/Wshadow-local-2.c b/gcc/testsuite/gcc.dg/Wshadow-local-2.c index 8f6b132..55ff978 100644 --- a/gcc/testsuite/gcc.dg/Wshadow-local-2.c +++ b/gcc/testsuite/gcc.dg/Wshadow-local-2.c @@ -40,10 +40,11 @@ int func3() { void func4() { struct Bar bar; /* { dg-message "shadowed declaration" } */ + /* { dg-bogus "shadows a global" "" { target *-*-* } .-1 } */ + if (val) { int bar; /* { dg-warning "shadows a previous local" } */ func1(bar); } } -/* { dg-bogus "shadows a global" "" { target *-*-* } 42 } */ diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c index 06a8a37..c44fc42 100644 --- a/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c +++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c @@ -6,10 +6,9 @@ int foo() { int i; *(long*)&i = 0; /* { dg-warning "type-punn" "type-punn" } */ + /* These messages are only expected for lp64, but fail there. When they + pass for lp64, replace "xfail *-*-*" with "target lp64". */ + /* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } .-3 } */ + /* { dg-message "initialized" "init" { xfail *-*-* } .-4 } */ return i; } - -/* These messages are only expected for lp64, but fail there. When they - pass for lp64, replace "xfail *-*-*" with "target lp64". */ -/* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } 8 } */ -/* { dg-message "initialized" "init" { xfail *-*-* } 8 } */ diff --git a/gcc/testsuite/gcc.dg/anon-struct-6.c b/gcc/testsuite/gcc.dg/anon-struct-6.c index 8ce14f4..792769b 100644 --- a/gcc/testsuite/gcc.dg/anon-struct-6.c +++ b/gcc/testsuite/gcc.dg/anon-struct-6.c @@ -7,6 +7,6 @@ struct s { int a; const; + /* { dg-warning "useless type qualifier in empty declaration" "empty" { target *-*-* } .-1 } */ + /* { dg-warning "empty declaration" "empty 2" { target *-*-* } .-2 } */ }; -/* { dg-warning "useless type qualifier in empty declaration" "empty" { target *-*-* } 9 } */ -/* { dg-warning "empty declaration" "empty 2" { target *-*-* } 9 } */ diff --git a/gcc/testsuite/gcc.dg/asm-wide-1.c b/gcc/testsuite/gcc.dg/asm-wide-1.c index c14b19d..88bbaed 100644 --- a/gcc/testsuite/gcc.dg/asm-wide-1.c +++ b/gcc/testsuite/gcc.dg/asm-wide-1.c @@ -14,10 +14,14 @@ f (void) asm (L"foo"); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ + /* Extra errors from the substitution of "" for wide strings: */ + /* { dg-error "output" "output" { target *-*-* } .-2 } */ asm ("foo" : [x] L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ + /* { dg-error "output" "output" { target *-*-* } .-1 } */ asm ("foo" : [x] "=g" (x), L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ + /* { dg-error "output" "output" { target *-*-* } .-1 } */ asm ("foo" : : L"g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : : : @@ -25,8 +29,3 @@ f (void) asm ("foo" : : : "memory", L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */ } - -/* Extra errors from the substitution of "" for wide strings: */ -/* { dg-error "output" "output" { target *-*-* } 16 } */ -/* { dg-error "output" "output" { target *-*-* } 18 } */ -/* { dg-error "output" "output" { target *-*-* } 20 } */ diff --git a/gcc/testsuite/gcc.dg/builtin-inf-1.c b/gcc/testsuite/gcc.dg/builtin-inf-1.c index d96a5b6..1e00bdc 100644 --- a/gcc/testsuite/gcc.dg/builtin-inf-1.c +++ b/gcc/testsuite/gcc.dg/builtin-inf-1.c @@ -1,13 +1,13 @@ /* { dg-do compile } */ float fi = __builtin_inff(); +/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* spu-*-* } .-1 } */ double di = __builtin_inf(); +/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } .-1 } */ long double li = __builtin_infl(); +/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } .-1 } */ float fh = __builtin_huge_valf(); double dh = __builtin_huge_val(); long double lh = __builtin_huge_vall(); -/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* spu-*-* } 3 } */ -/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } 4 } */ -/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } 5 } */ diff --git a/gcc/testsuite/gcc.dg/builtin-redefine.c b/gcc/testsuite/gcc.dg/builtin-redefine.c index 9b21afd..8090015 100644 --- a/gcc/testsuite/gcc.dg/builtin-redefine.c +++ b/gcc/testsuite/gcc.dg/builtin-redefine.c @@ -25,10 +25,10 @@ #undef __TIME__ /* Undefine while already undefined. */ #define __TIME__ "X" /* Define while undefined. */ -#define __TIME__ "X" /* Re-define while defined. */ +#define __TIME__ "X" /* Re-define while defined. */ /* { dg-line time_prev } */ #define __TIME__ "Y" /* { dg-warning "\"__TIME__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } 28 } */ +/* { dg-message "previous definition" "" { target *-*-* } time_prev } */ #undef __TIME__ /* Undefine while defined. */ @@ -36,19 +36,19 @@ #undef __DATE__ /* Undefine while already undefined. */ #define __DATE__ "X" /* Define while undefined. */ -#define __DATE__ "X" /* Re-define while defined. */ +#define __DATE__ "X" /* Re-define while defined. */ /* { dg-line date_prev } */ #define __DATE__ "Y" /* { dg-warning "\"__DATE__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } 39 } */ +/* { dg-message "previous definition" "" { target *-*-* } date_prev } */ #undef __DATE__ /* Undefine while defined. */ #define __TIMESTAMP__ "X" /* Define while already defined. */ -#define __TIMESTAMP__ "X" /* Re-define while defined. */ +#define __TIMESTAMP__ "X" /* Re-define while defined. */ /* { dg-line timestamp_prev } */ #define __TIMESTAMP__ "Y" /* { dg-warning "\"__TIMESTAMP__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } 48 } */ +/* { dg-message "previous definition" "" { target *-*-* } timestamp_prev } */ #undef __TIMESTAMP__ /* Undefine while defined. */ diff --git a/gcc/testsuite/gcc.dg/c90-array-lval-6.c b/gcc/testsuite/gcc.dg/c90-array-lval-6.c index f42ef52..dc57ed7 100644 --- a/gcc/testsuite/gcc.dg/c90-array-lval-6.c +++ b/gcc/testsuite/gcc.dg/c90-array-lval-6.c @@ -12,5 +12,5 @@ extern struct s foo(void); void bar(void) { char *ptr = foo().c; /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } .-1 } */ } -/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 14 } */ diff --git a/gcc/testsuite/gcc.dg/c90-array-lval-7.c b/gcc/testsuite/gcc.dg/c90-array-lval-7.c index ee8da4c..9b41777 100644 --- a/gcc/testsuite/gcc.dg/c90-array-lval-7.c +++ b/gcc/testsuite/gcc.dg/c90-array-lval-7.c @@ -18,6 +18,5 @@ bar (void) 6.3.15 does not permit conditional expressions between arrays. In C99, they decay to pointers. */ (e ? (d ? b : c).c : (e ? b : c).c); /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "array" "bad conditional" { target *-*-* } .-1 } */ } - -/* { dg-error "array" "bad conditional" { target *-*-* } 20 } */ diff --git a/gcc/testsuite/gcc.dg/c90-fordecl-1.c b/gcc/testsuite/gcc.dg/c90-fordecl-1.c index 51e82ff..0fb9b20 100644 --- a/gcc/testsuite/gcc.dg/c90-fordecl-1.c +++ b/gcc/testsuite/gcc.dg/c90-fordecl-1.c @@ -8,7 +8,7 @@ foo (void) { int j = 0; for (int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "'for' loop initial declarations are only allowed in C99 or C11 mode" "declaration in for loop" { target *-*-* } .-1 } */ + /* { dg-message "note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code" "note" { target *-*-* } .-2 }} */ j += i; - /* { dg-error "'for' loop initial declarations are only allowed in C99 or C11 mode" "declaration in for loop" { target *-*-* } 10 } */ - /* { dg-message "note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code" "note" { target *-*-* } 10 }} */ } diff --git a/gcc/testsuite/gcc.dg/c99-fordecl-2.c b/gcc/testsuite/gcc.dg/c99-fordecl-2.c index 0ef11f6..aa5bc78 100644 --- a/gcc/testsuite/gcc.dg/c99-fordecl-2.c +++ b/gcc/testsuite/gcc.dg/c99-fordecl-2.c @@ -10,19 +10,23 @@ foo (void) behind these tests. */ int j = 0; for (int i = 1, bar (void); i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "bar" "function in for loop" { target *-*-* } .-1 } */ j += i; - /* { dg-error "bar" "function in for loop" { target *-*-* } 12 } */ + for (static int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "static" "static in for loop" { target *-*-* } .-1 } */ j += i; - /* { dg-error "static" "static in for loop" { target *-*-* } 15 } */ + for (extern int i; j <= 500; j++) /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "extern" "extern in for loop" { target *-*-* } .-1 } */ j += 5; - /* { dg-error "extern" "extern in for loop" { target *-*-* } 18 } */ + for (enum { FOO } i = FOO; i < 10; i++) /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "FOO" "enum value in for loop" { target *-*-* } .-1 } */ j += i; - /* { dg-error "FOO" "enum value in for loop" { target *-*-* } 21 } */ + for (enum BAR { FOO } i = FOO; i < 10; i++) /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "FOO" "enum value in for loop" { target *-*-* } .-1 } */ + /* { dg-error "BAR" "enum tag in for loop" { target *-*-* } .-2 } */ j += i; - /* { dg-error "FOO" "enum value in for loop" { target *-*-* } 24 } */ - /* { dg-error "BAR" "enum tag in for loop" { target *-*-* } 24 } */ } diff --git a/gcc/testsuite/gcc.dg/cast-lvalue-1.c b/gcc/testsuite/gcc.dg/cast-lvalue-1.c index 4e84804..ef3ae0a 100644 --- a/gcc/testsuite/gcc.dg/cast-lvalue-1.c +++ b/gcc/testsuite/gcc.dg/cast-lvalue-1.c @@ -9,5 +9,5 @@ void foo (void) { (char) x = 1; /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "lvalue" "cast as lvalue" { target *-*-* } .-1 } */ } -/* { dg-error "lvalue" "cast as lvalue" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/cast-lvalue-2.c b/gcc/testsuite/gcc.dg/cast-lvalue-2.c index d4db4bd..0dcbedc 100644 --- a/gcc/testsuite/gcc.dg/cast-lvalue-2.c +++ b/gcc/testsuite/gcc.dg/cast-lvalue-2.c @@ -9,5 +9,5 @@ void foo (void) { (int) x = 1; /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "lvalue" "cast as lvalue" { target *-*-* } .-1 } */ } -/* { dg-error "lvalue" "cast as lvalue" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/compound-lvalue-1.c b/gcc/testsuite/gcc.dg/compound-lvalue-1.c index 30ed58f..ffff76e 100644 --- a/gcc/testsuite/gcc.dg/compound-lvalue-1.c +++ b/gcc/testsuite/gcc.dg/compound-lvalue-1.c @@ -9,5 +9,5 @@ void foo (void) { (x, y) = 1; /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "lvalue" "compound expression as lvalue" { target *-*-* } .-1 } */ } -/* { dg-error "lvalue" "compound expression as lvalue" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/cond-lvalue-1.c b/gcc/testsuite/gcc.dg/cond-lvalue-1.c index f2605af..d7995c7 100644 --- a/gcc/testsuite/gcc.dg/cond-lvalue-1.c +++ b/gcc/testsuite/gcc.dg/cond-lvalue-1.c @@ -9,5 +9,5 @@ void foo (void) { (x ? y : z) = 1; /* { dg-bogus "warning" "warning in place of error" } */ + /* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } .-1 } */ } -/* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/20000419-1.c b/gcc/testsuite/gcc.dg/cpp/20000419-1.c index c4400ee..c237316 100644 --- a/gcc/testsuite/gcc.dg/cpp/20000419-1.c +++ b/gcc/testsuite/gcc.dg/cpp/20000419-1.c @@ -10,6 +10,5 @@ __REDIRECT (a, b, c) __ASMNAME2 (__USER_LABEL_PREFIX__, harumph) - -/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 11 } */ -/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 12 } */ +/* { dg-bogus "used without args" "no args, 1" { target *-*-* } .-2 } */ +/* { dg-bogus "used without args" "no args, 1" { target *-*-* } .-2 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/backslash.c b/gcc/testsuite/gcc.dg/cpp/backslash.c index f1b094a..3255a6a 100644 --- a/gcc/testsuite/gcc.dg/cpp/backslash.c +++ b/gcc/testsuite/gcc.dg/cpp/backslash.c @@ -5,16 +5,15 @@ b, \ c -/* Note the trailing whitespace on the next three lines. */ +/* Note the trailing whitespace on the first three lines of beta def. */ +/* { dg-warning "separated by space" "space" { target *-*-* } .+3 } */ +/* { dg-warning "separated by space" "tab" { target *-*-* } .+3 } */ +/* { dg-warning "separated by space" "space and tab" { target *-*-* } .+3 } */ #define beta(a, b, c) \ a, \ b, \ c -/* { dg-warning "separated by space" "space" { target *-*-* } 9 } */ -/* { dg-warning "separated by space" "tab" { target *-*-* } 10 } */ -/* { dg-warning "separated by space" "space and tab" { target *-*-* } 11 } */ - int x[] = { alpha(1, 2, 3), beta(4, 5, 6) diff --git a/gcc/testsuite/gcc.dg/cpp/backslash2.c b/gcc/testsuite/gcc.dg/cpp/backslash2.c index 65142d9..5c10e86 100644 --- a/gcc/testsuite/gcc.dg/cpp/backslash2.c +++ b/gcc/testsuite/gcc.dg/cpp/backslash2.c @@ -7,8 +7,8 @@ foo \ bar -/* { dg-warning "separated by space" "" { target *-*-* } 8 } */ +/* { dg-warning "separated by space" "" { target *-*-* } .-2 } */ /* foo \ bar */ -/* { dg-bogus "separated by space" "" { target *-*-* } 12 } */ +/* { dg-bogus "separated by space" "" { target *-*-* } .-2 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/macspace1.c b/gcc/testsuite/gcc.dg/cpp/macspace1.c index d857844..b920f89 100644 --- a/gcc/testsuite/gcc.dg/cpp/macspace1.c +++ b/gcc/testsuite/gcc.dg/cpp/macspace1.c @@ -4,10 +4,12 @@ #define a! /* { dg-warning "missing whitespace" } */ #define b" /* { dg-warning "missing whitespace" } */ +/* { dg-error "missing terminating" "" { target *-*-* } .-1 } */ #define c# /* { dg-warning "missing whitespace" } */ #define d% /* { dg-warning "missing whitespace" } */ #define e& /* { dg-warning "missing whitespace" } */ #define f' /* { dg-warning "missing whitespace" } */ +/* { dg-error "missing terminating" "" { target *-*-* } .-1 } */ #define g) /* { dg-warning "missing whitespace" } */ #define h* /* { dg-warning "missing whitespace" } */ #define i+ /* { dg-warning "missing whitespace" } */ @@ -59,5 +61,3 @@ #define ag"abc" /* { dg-warning "missing whitespace" } */ int dummy; -/* { dg-error "missing terminating" "" { target *-*-* } 6 } */ -/* { dg-error "missing terminating" "" { target *-*-* } 10 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/macspace2.c b/gcc/testsuite/gcc.dg/cpp/macspace2.c index 6e6be96..87716d6 100644 --- a/gcc/testsuite/gcc.dg/cpp/macspace2.c +++ b/gcc/testsuite/gcc.dg/cpp/macspace2.c @@ -4,10 +4,12 @@ #define a! /* { dg-error "requires whitespace" } */ #define b" /* { dg-error "requires whitespace" } */ +/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } .-1 } */ #define c# /* { dg-error "requires whitespace" } */ #define d% /* { dg-error "requires whitespace" } */ #define e& /* { dg-error "requires whitespace" } */ #define f' /* { dg-error "requires whitespace" } */ +/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } .-1 } */ #define g) /* { dg-error "requires whitespace" } */ #define h* /* { dg-error "requires whitespace" } */ #define i+ /* { dg-error "requires whitespace" } */ @@ -59,5 +61,3 @@ #define ag"abc" /* { dg-error "requires whitespace" } */ int dummy; -/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 6 } */ -/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 10 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/multiline-2.c b/gcc/testsuite/gcc.dg/cpp/multiline-2.c index 2841e00..6ffeb2a 100644 --- a/gcc/testsuite/gcc.dg/cpp/multiline-2.c +++ b/gcc/testsuite/gcc.dg/cpp/multiline-2.c @@ -8,7 +8,6 @@ const char *p = "line 1 " ""; /* The compiler front end sees this. */ - -/* { dg-error "17:missing term" "multiline strings" { target *-*-* } 8 } */ -/* { dg-error "missing term" "multiline strings" { target *-*-* } 9 } */ +/* { dg-error "17:missing term" "multiline strings" { target *-*-* } .-3 } */ +/* { dg-error "missing term" "multiline strings" { target *-*-* } .-3 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/pr27777.c b/gcc/testsuite/gcc.dg/cpp/pr27777.c index 89258b9..50e2459 100644 --- a/gcc/testsuite/gcc.dg/cpp/pr27777.c +++ b/gcc/testsuite/gcc.dg/cpp/pr27777.c @@ -3,6 +3,5 @@ /* { dg-options { -trigraphs -Wall } } */ #error "BUG??!" - -/* { dg-error "BUG" "" { target *-*-* } 5 } */ -/* { dg-warning "trigraph" "" { target *-*-* } 5 } */ +/* { dg-error "BUG" "" { target *-*-* } .-1 } */ +/* { dg-warning "trigraph" "" { target *-*-* } .-2 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/pr30786.c b/gcc/testsuite/gcc.dg/cpp/pr30786.c index 2c36108..5bcccda 100644 --- a/gcc/testsuite/gcc.dg/cpp/pr30786.c +++ b/gcc/testsuite/gcc.dg/cpp/pr30786.c @@ -1,9 +1,8 @@ /* PR preprocessor/30786 - _Pragma at end of file should not ICE */ /* { dg-do compile } */ -/* { dg-error "parenthesized" "parenthesized" { target *-*-* } 9 } */ -/* { dg-error "expected" "expected" { target *-*-* } 9 } */ - int x; +/* { dg-error "parenthesized" "parenthesized" { target *-*-* } .+2 } */ +/* { dg-error "expected" "expected" { target *-*-* } .+1 } */ _Pragma diff --git a/gcc/testsuite/gcc.dg/cpp/pr34602.c b/gcc/testsuite/gcc.dg/cpp/pr34602.c index 343c091..eb24ead 100644 --- a/gcc/testsuite/gcc.dg/cpp/pr34602.c +++ b/gcc/testsuite/gcc.dg/cpp/pr34602.c @@ -1,6 +1,5 @@ /* PR preprocessor/34602 - no internal error trying to spell EOF. */ /* { dg-do preprocess } */ -/* { dg-error "unexpected end" "" { target *-*-* } 6 } */ - +/* { dg-error "unexpected end" "" { target *-*-* } .+1 } */ #line diff --git a/gcc/testsuite/gcc.dg/cpp/redef1.c b/gcc/testsuite/gcc.dg/cpp/redef1.c index a5fe2ba..2b5304c 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef1.c +++ b/gcc/testsuite/gcc.dg/cpp/redef1.c @@ -5,15 +5,14 @@ #define foo bar #define /* x */ foo /* x */ bar /* x */ +/* { dg-bogus "redefined" "foo redefined" { target *-*-* } .-1 } */ +/* { dg-bogus "previous def" "foo prev def" { target *-*-* } .-3 } */ -#define quux(thud) a one and a thud and a two -#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two -#define quux(thud) a one and a thud and a two /* bah */ +#define quux(thud) a one and a thud and a two /* { dg-line quux_def_1 } */ +#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two /* { dg-line quux_def_2 } */ +/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_2 } */ +/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_1 } */ -/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 7 } */ -/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 10 } */ -/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */ - -/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 6 } */ -/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 9 } */ -/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */ +#define quux(thud) a one and a thud and a two /* bah */ /* { dg-line quux_def_3 } */ +/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_3 } */ +/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_2 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn1.c b/gcc/testsuite/gcc.dg/cpp/tr-warn1.c index 37b5efe..20fe44e 100644 --- a/gcc/testsuite/gcc.dg/cpp/tr-warn1.c +++ b/gcc/testsuite/gcc.dg/cpp/tr-warn1.c @@ -20,9 +20,13 @@ _and_ they should get a -pedantic warning. */ #assert foo(bar) /* { dg-warning "indented" "^#ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ # assert bar(baz) /* { dg-warning "indented" "^# ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ #assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ # assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ /* We warn of #elif regardless of whether we're skipping or not, and do not warn about indentaion. */ @@ -32,8 +36,3 @@ #endif #elif 0 /* { dg-warning "#elif" "#elif not skipping" } */ #endif - -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 22 } */ -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 23 } */ -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 24 } */ -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 25 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn3.c b/gcc/testsuite/gcc.dg/cpp/tr-warn3.c index 3351718..85b7014 100644 --- a/gcc/testsuite/gcc.dg/cpp/tr-warn3.c +++ b/gcc/testsuite/gcc.dg/cpp/tr-warn3.c @@ -25,9 +25,13 @@ they should get a -pedantic warning. */ #assert foo(bar) /* { dg-warning "indented" "^#ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ # assert bar(baz) /* { dg-warning "indented" "^# ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ #assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ # assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */ +/* { dg-warning "GCC extension" "extension warning" { target *-*-* } .-1 } */ #else @@ -54,8 +58,3 @@ # unassert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */ #endif - -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 27 } */ -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 28 } */ -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 29 } */ -/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 30 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn6.c b/gcc/testsuite/gcc.dg/cpp/tr-warn6.c index d95409e..137064e 100644 --- a/gcc/testsuite/gcc.dg/cpp/tr-warn6.c +++ b/gcc/testsuite/gcc.dg/cpp/tr-warn6.c @@ -11,9 +11,8 @@ #define foo5(h2) sdf 'h2' fds 'h3' /* { dg-warning "macro argument \"h2\" would be stringified" "traditional stringification" } */ #define foo6(h3) sdf 'h2' fds 'h3' /* { dg-warning "macro argument \"h3\" would be stringified" "traditional stringification" } */ #define foo7(AA, hello, world, EEE) sdf "A B hello C,world,DhelloE F" fds EEE /* { dg-warning "macro argument \"hello\" would be stringified" "traditional stringification" } */ - /* Catch the second warning from the above line. */ -/* { dg-warning "macro argument \"world\" would be stringified" "traditional stringification second warning" { target *-*-* } 13 } */ +/* { dg-warning "macro argument \"world\" would be stringified" "traditional stringification second warning" { target *-*-* } .-2 } */ # 19 "sys-header.h" 3 /* We are in system headers now, no -Wtraditional warnings should issue. */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/hash.c b/gcc/testsuite/gcc.dg/cpp/trad/hash.c index 8108c89..4ddd965 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/hash.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/hash.c @@ -5,10 +5,9 @@ #ifndef foo #define foo /**/ #endif +/* { dg-bogus "(start|end) of macro" "paste at end" { target *-*-* } .-1 } */ #ifndef foo #define foo /* as nothing */ #endif - -/* { dg-bogus "(start|end) of macro" "paste at end" { target *-*-* } 7 } */ -/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } 11 } */ +/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } .-1 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/redef1.c b/gcc/testsuite/gcc.dg/cpp/trad/redef1.c index ce5dde0..ba17569 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/redef1.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/redef1.c @@ -6,31 +6,30 @@ #define foo bar #define /* x */ foo /* x */ bar /* x */ +/* { dg-bogus "redefined" "foo redefined" { target *-*-* } .-1 } */ +/* { dg-bogus "previous def" "foo prev def" { target *-*-* } .-3 } */ -#define quux(thud) a one and a thud and a two -#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two -#define quux(thud) a one and a thud and a two /* bah */ +#define quux(thud) a one and a thud and a two /* { dg-line quux_def_1 } */ +#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two /* { dg-line quux_def_2 } */ +/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_2 } */ +/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_1 } */ + +#define quux(thud) a one and a thud and a two /* bah */ /* { dg-line quux_def_3 } */ +/* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_3 } */ +/* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_2 } */ #define f(x, y)x "x y z" y #define f(x, y) x "x y z" y +/* { dg-bogus "redefined" "f redefined" { target *-*-* } .-1 } */ +/* { dg-bogus "previous def" "f prev def" { target *-*-* } .-3 } */ #define baz() whiz bang #define baz() whiz bang +/* { dg-bogus "redefined" "baz redefined" { target *-*-* } .-1 } */ +/* { dg-bogus "previous def" "baz prev def" { target *-*-* } .-3 } */ #define g foo #undef g #define g - -/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 8 } */ -/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */ -/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 12 } */ -/* { dg-bogus "redefined" "f redefined" { target *-*-* } 15 } */ -/* { dg-bogus "redefined" "baz redefined" { target *-*-* } 18 } */ -/* { dg-bogus "redefined" "g redefined" { target *-*-* } 22 } */ - -/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 7 } */ -/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */ -/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 11 } */ -/* { dg-bogus "previous def" "f prev def" { target *-*-* } 14 } */ -/* { dg-bogus "previous def" "baz prev def" { target *-*-* } 17 } */ -/* { dg-bogus "previous def" "g prev def" { target *-*-* } 20 } */ +/* { dg-bogus "redefined" "g redefined" { target *-*-* } .-1 } */ +/* { dg-bogus "previous def" "g prev def" { target *-*-* } .-4 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/ucs.c b/gcc/testsuite/gcc.dg/cpp/ucs.c index 3f3d97e..4f76fa9 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucs.c +++ b/gcc/testsuite/gcc.dg/cpp/ucs.c @@ -54,7 +54,7 @@ void foo () c = L'\u000x'; /* { dg-error "incomplete" "non-hex digit in UCN" } */ /* If sizeof(HOST_WIDE_INT) > sizeof(wchar_t), we can get a multi-character constant warning even for wide characters. */ - /* { dg-warning "too long|multi-character" "" { target *-*-* } 54 } */ + /* { dg-warning "too long|multi-character" "" { target *-*-* } .-3 } */ c = '\u0024'; /* { dg-bogus "invalid" "0024 is a valid UCN" } */ c = "\u0040"[0]; /* { dg-bogus "invalid" "0040 is a valid UCN" } */ diff --git a/gcc/testsuite/gcc.dg/declspec-10.c b/gcc/testsuite/gcc.dg/declspec-10.c index fa46566..241422b 100644 --- a/gcc/testsuite/gcc.dg/declspec-10.c +++ b/gcc/testsuite/gcc.dg/declspec-10.c @@ -16,7 +16,10 @@ void f6 (static int); /* { dg-error "storage class specified for unnamed paramet void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */ auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */ -register int y; /* { dg-warning "file-scope declaration of 'y' specifies 'register'" } */ + +register int y; +/* { dg-warning "file-scope declaration of 'y' specifies 'register'" "" { target *-*-* } .-1 } */ +/* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } .-2 } */ void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */ /* { dg-warning "ISO C forbids nested functions" "nested" { target *-*-* } .-1 } */ @@ -43,5 +46,3 @@ void i (void) { auto void y (void) {} } /* { dg-warning "ISO C forbids nested fu /* { dg-warning "function definition declared 'auto'" "nested" { target *-*-* } .-1 } */ inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */ - -/* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } 19 } */ diff --git a/gcc/testsuite/gcc.dg/declspec-11.c b/gcc/testsuite/gcc.dg/declspec-11.c index d9fafde..58f35ab 100644 --- a/gcc/testsuite/gcc.dg/declspec-11.c +++ b/gcc/testsuite/gcc.dg/declspec-11.c @@ -16,7 +16,10 @@ void f6 (static int); /* { dg-error "storage class specified for unnamed paramet void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */ auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */ -register int y; /* { dg-error "file-scope declaration of 'y' specifies 'register'" } */ + +register int y; +/* { dg-error "file-scope declaration of 'y' specifies 'register'" "" { target *-*-* } .-1 } */ +/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } .-2 } */ void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */ /* { dg-error "ISO C forbids nested functions" "nested" { target *-*-* } .-1 } */ @@ -43,5 +46,3 @@ void i (void) { auto void y (void) {} } /* { dg-error "ISO C forbids nested func /* { dg-error "function definition declared 'auto'" "nested" { target *-*-* } .-1 } */ inline int main (void) { return 0; } /* { dg-error "cannot inline function 'main'" } */ - -/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */ diff --git a/gcc/testsuite/gcc.dg/declspec-18.c b/gcc/testsuite/gcc.dg/declspec-18.c index 0a11178..2885692 100644 --- a/gcc/testsuite/gcc.dg/declspec-18.c +++ b/gcc/testsuite/gcc.dg/declspec-18.c @@ -23,36 +23,48 @@ struct s { }; typeof (z) c1; -typeof (x1) c2; /* { dg-error "undeclared" "undeclared" } */ + +typeof (x1) c2; +/* { dg-error "undeclared" "undeclared" { target *-*-* } .-1 } */ +/* { dg-bogus "unknown type name 'x1'" "unknown" { target *-*-* } .-2 } */ + typeof (const t11) c3; /* { dg-error "unknown type name 't11'" } */ -typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } } */ -/* { dg-bogus "unknown type name 'x1'" unknown"" { target *-*-* } 26 } */ -/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 28 } */ -/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 28 } */ + +typeof (t12 *) c3; +/* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } .-1 } */ +/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } .-2 } */ +/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } .-3 } */ int recover1; int s0 = sizeof (z); -int s1 = sizeof (x2); /* { dg-error "undeclared" "undeclared" } */ + +int s1 = sizeof (x2); +/* { dg-error "undeclared" "undeclared" { target *-*-* } .-1 } */ +/* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } .-2 } */ + int s2 = sizeof (const t13); /* { dg-error "unknown type name 't13'" } */ -int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } } */ -int recover2; +int s3 = sizeof (t14 *); +/* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } .-1 } */ +/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } .-2 } */ +/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } .-3 } */ -/* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } 36 } */ -/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 38 } */ -/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 38 } */ +int recover2; int a0 = __alignof__ (z); + int a1 = __alignof__ (x3); /* { dg-error "undeclared" } */ +/* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } .-1 } */ + int a2 = __alignof__ (const t15); /* { dg-error "unknown type name 't15'" } */ -int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } } */ -int recover3; +int a3 = __alignof__ (t16 *); +/* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } .-1 } */ +/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } .-2 } */ +/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } .-3 } */ -/* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } 47 } */ -/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 49 } */ -/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 49 } */ +int recover3; /* Cannot detect (undefd_type *) or (undefd_type (*) because it would diff --git a/gcc/testsuite/gcc.dg/format/c99-strftime-1.c b/gcc/testsuite/gcc.dg/format/c99-strftime-1.c index 7530bbd..99a2fc6 100644 --- a/gcc/testsuite/gcc.dg/format/c99-strftime-1.c +++ b/gcc/testsuite/gcc.dg/format/c99-strftime-1.c @@ -29,10 +29,10 @@ foo (char *s, size_t m, const struct tm *tp) /* Bad uses of %E and %O. */ strftime (s, m, "%EEY", tp); /* { dg-warning "multiple|repeated" "multiple %E/%O" } */ strftime (s, m, "%EOy", tp); /* { dg-warning "multiple|together" "multiple %E/%O" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%OEy", tp); /* { dg-warning "multiple|together" "multiple %E/%O" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%OOV", tp); /* { dg-warning "multiple|repeated" "multiple %E/%O" } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 31 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 32 } */ strftime (s, m, "%Ea", tp); /* { dg-warning "flag|modifier" "bad %Ea" } */ strftime (s, m, "%EA", tp); /* { dg-warning "flag|modifier" "bad %EA" } */ strftime (s, m, "%Eb", tp); /* { dg-warning "flag|modifier" "bad %Eb" } */ diff --git a/gcc/testsuite/gcc.dg/format/ext-3.c b/gcc/testsuite/gcc.dg/format/ext-3.c index 937e112..a59edb4 100644 --- a/gcc/testsuite/gcc.dg/format/ext-3.c +++ b/gcc/testsuite/gcc.dg/format/ext-3.c @@ -85,31 +85,33 @@ foo (char *s, size_t m, const struct tm *tp) strftime (s, m, "%-Z", tp); /* { dg-warning "flag" "bad %Z" } */ strftime (s, m, "%_Z", tp); /* { dg-warning "flag" "bad %Z" } */ strftime (s, m, "%0Z", tp); /* { dg-warning "flag" "bad %Z" } */ + /* Incorrect usages with Y2K problems. */ strftime (s, m, "%5c", tp); /* { dg-warning "width" "bad %c" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%-c", tp); /* { dg-warning "flag" "bad %c" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%_c", tp); /* { dg-warning "flag" "bad %c" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%0c", tp); /* { dg-warning "flag" "bad %c" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%5D", tp); /* { dg-warning "width" "bad %D" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%-D", tp); /* { dg-warning "flag" "bad %D" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%_D", tp); /* { dg-warning "flag" "bad %D" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%0D", tp); /* { dg-warning "flag" "bad %D" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%5x", tp); /* { dg-warning "width" "bad %x" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%-x", tp); /* { dg-warning "flag" "bad %x" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%_x", tp); /* { dg-warning "flag" "bad %x" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%0x", tp); /* { dg-warning "flag" "bad %x" } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 89 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 90 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 91 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 92 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 93 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 94 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 95 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 96 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 97 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 98 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 99 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 100 } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ + /* Incorrect usages with GNU extension conversion characters. */ strftime (s, m, "%5P", tp); /* { dg-warning "width" "bad %P" } */ strftime (s, m, "%-P", tp); /* { dg-warning "flag" "bad %P" } */ @@ -178,27 +180,29 @@ foo (char *s, size_t m, const struct tm *tp) strftime (s, m, "%#l", tp); /* { dg-warning "flag" "bad %l" } */ strftime (s, m, "%^s", tp); /* { dg-warning "flag" "bad %s" } */ strftime (s, m, "%#s", tp); /* { dg-warning "flag" "bad %s" } */ + /* Bad usages with Y2K problems. */ strftime (s, m, "%^c", tp); /* { dg-warning "flag" "bad %c" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%#c", tp); /* { dg-warning "flag" "bad %c" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%^D", tp); /* { dg-warning "flag" "bad %D" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%#D", tp); /* { dg-warning "flag" "bad %D" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%^g", tp); /* { dg-warning "flag" "bad %g" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%#g", tp); /* { dg-warning "flag" "bad %g" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%^x", tp); /* { dg-warning "flag" "bad %x" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%#x", tp); /* { dg-warning "flag" "bad %x" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%^y", tp); /* { dg-warning "flag" "bad %y" } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ strftime (s, m, "%#y", tp); /* { dg-warning "flag" "bad %y" } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 182 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 183 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 184 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 185 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 186 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 187 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 188 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 189 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 190 } */ - /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 191 } */ + /* { dg-warning "only last 2" "2-digit year" { target *-*-* } .-1 } */ + /* GCC also accepts the glibc format extensions %P, %k, %l, %s. */ strftime (s, m, "%P%k%l%s", tp); /* GCC also accepts the glibc extension of the "O" modifier on some diff --git a/gcc/testsuite/gcc.dg/format/pr72858.c b/gcc/testsuite/gcc.dg/format/pr72858.c index d8d0499..c142d24 100644 --- a/gcc/testsuite/gcc.dg/format/pr72858.c +++ b/gcc/testsuite/gcc.dg/format/pr72858.c @@ -389,19 +389,21 @@ test_LE (char *d, int iexpr, float fexpr, double dexpr, long double ldexpr) void test_everything (char *d, long lexpr) { - sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr); /* { dg-warning "26: field width specifier '\\*' expects argument of type 'int', but argument 3 has type 'long int'" } */ + sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr); /* { dg-line test_everything_sprintf } */ + + /* { dg-warning "26: field width specifier '\\*' expects argument of type 'int', but argument 3 has type 'long int'" "" { target *-*-* } test_everything_sprintf } */ /* { dg-begin-multiline-output "" } sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr); ~~~^~~~~~ { dg-end-multiline-output "" } */ - /* { dg-warning "28: field precision specifier '\\.\\*' expects argument of type 'int', but argument 4 has type 'long int'" "" { target *-*-* } 392 } */ + /* { dg-warning "28: field precision specifier '\\.\\*' expects argument of type 'int', but argument 4 has type 'long int'" "" { target *-*-* } test_everything_sprintf } */ /* { dg-begin-multiline-output "" } sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr); ~~~~~^~~~ { dg-end-multiline-output "" } */ - /* { dg-warning "31: format '%lld' expects argument of type 'long long int', but argument 5 has type 'long int'" "" { target *-*-* } 392 } */ + /* { dg-warning "31: format '%lld' expects argument of type 'long long int', but argument 5 has type 'long int'" "" { target *-*-* } test_everything_sprintf } */ /* { dg-begin-multiline-output "" } sprintf (d, "before %-+*.*lld after", lexpr, lexpr, lexpr); ~~~~~~~~^ diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c index 1333b70..e0f0eca 100644 --- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c +++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c @@ -10,7 +10,7 @@ a24 (int a) const int c = 1; int i = 0; int l = 0; -#pragma omp parallel default(none) private(a) shared(z) +#pragma omp parallel default(none) private(a) shared(z) /* { dg-line omp_parallel } */ { int j = omp_get_num_threads (); /* O.K. - j is declared within parallel region */ @@ -20,8 +20,8 @@ a24 (int a) /* - c has const-qualified type */ z[i] = y; /* { dg-error "'i' not specified" "" { target *-*-* } .-1 } */ - /* { dg-error "enclosing 'parallel'" "" { target *-*-* } 13 } */ - /* { dg-error "'y' not specified" "" { target *-*-* } 21 } */ + /* { dg-error "enclosing 'parallel'" "" { target *-*-* } omp_parallel } */ + /* { dg-error "'y' not specified" "" { target *-*-* } .-3 } */ #pragma omp for firstprivate(y) for (i = 0; i < 10; i++) { diff --git a/gcc/testsuite/gcc.dg/init-string-1.c b/gcc/testsuite/gcc.dg/init-string-1.c index 19bdf64..67bd796 100644 --- a/gcc/testsuite/gcc.dg/init-string-1.c +++ b/gcc/testsuite/gcc.dg/init-string-1.c @@ -29,8 +29,9 @@ struct s j = { "j", 1, (L"j") + /* { dg-error "parenthesized|near init" "paren array" { target *-*-* } .-1 } */ }; /* { dg-bogus "warning" "warning in place of error" } */ -/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 31 } */ + struct s k = { (("k")), /* { dg-bogus "warning" "warning in place of error" } */ /* { dg-error "parenthesized|near init" "paren array" { target *-*-* } .-1 } */ @@ -47,8 +48,8 @@ struct s l = { struct s m = { .c = L"m", .a = ("m") + /* { dg-error "parenthesized|near init" "paren array" { target *-*-* } .-1 } */ }; /* { dg-bogus "warning" "warning in place of error" } */ -/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 49 } */ char *n = (char []){ "n" }; diff --git a/gcc/testsuite/gcc.dg/label-decl-3.c b/gcc/testsuite/gcc.dg/label-decl-3.c index 32daea8..2e9ea09 100644 --- a/gcc/testsuite/gcc.dg/label-decl-3.c +++ b/gcc/testsuite/gcc.dg/label-decl-3.c @@ -10,8 +10,8 @@ void f (void) { __label__ a, b, c, d; + /* { dg-error "ISO C forbids label declarations" "label decls" { target *-*-* } .-1 } */ __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */ - /* { dg-error "ISO C forbids label declarations" "label decls" { target *-*-* } 12 } */ goto c; /* { dg-error "label 'c' used but not defined" } */ a: (void)0; b: (void)0; diff --git a/gcc/testsuite/gcc.dg/m-un-2.c b/gcc/testsuite/gcc.dg/m-un-2.c index b12c7cb..141b81b 100644 --- a/gcc/testsuite/gcc.dg/m-un-2.c +++ b/gcc/testsuite/gcc.dg/m-un-2.c @@ -9,14 +9,14 @@ extern void* realloc (void*, size_t); struct vtable { void* (* _malloc) (size_t); void (* _free) (void*); - void* (* _realloc) (void*, size_t); + void* (* _realloc) (void*, size_t); /* { dg-line vtable_realloc } */ }; struct vtable mtable = { malloc, free }; /* { dg-warning "missing initializer" "warning regression" } */ - /* { dg-message "declared here" "warning regression 2" { target *-*-* } 12 } */ + /* { dg-message "declared here" "warning regression 2" { target *-*-* } vtable_realloc } */ /* With designated initializers, we assume you meant to leave out the initialization of any blank fields. */ diff --git a/gcc/testsuite/gcc.dg/nofixed-point-2.c b/gcc/testsuite/gcc.dg/nofixed-point-2.c index 8442a19..166a6bc 100644 --- a/gcc/testsuite/gcc.dg/nofixed-point-2.c +++ b/gcc/testsuite/gcc.dg/nofixed-point-2.c @@ -20,10 +20,10 @@ f3 (void) return 0k; /* { dg-error "not supported" "reject fixed-point" } */ } -_Sat /* { dg-error "not supported" "reject fixed-point" } */ +_Sat +/* { dg-error "not supported" "reject fixed-point" { target *-*-* } .-1 } */ +/* { dg-error "is used without" "" { target *-*-* } .-2 } */ f4 (void) { return 0k; /* { dg-error "not supported" "reject fixed-point" } */ } - -/* { dg-error "is used without" "" { target *-*-* } 23 } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/20020213-1.c b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c index 41480f0..fa86e47 100644 --- a/gcc/testsuite/gcc.dg/noncompile/20020213-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c @@ -2,9 +2,15 @@ Test whether argument checking is done for fputs, bzero and bcmp. */ typedef struct { int i; } FILE; typedef __SIZE_TYPE__ size_t; + int fputs (const char *, FILE *); +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */ + void bzero (void *, size_t); +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */ + int bcmp (const void *, const void *, size_t); +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */ char buf[32]; FILE *f; @@ -12,23 +18,26 @@ FILE *f; int main () { fputs ("foo"); /* { dg-error "too few" } */ + fputs ("foo", "bar", "baz"); /* { dg-error "too many" } */ + /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-1 } */ + fputs (21, 43); + /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */ + /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-2 } */ + bzero (buf); /* { dg-error "too few" } */ + bzero (21); /* { dg-error "too few" } */ + /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */ + bcmp (buf, buf + 16); /* { dg-error "too few" } */ + bcmp (21); /* { dg-error "too few" } */ + /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */ + fputs ("foo", f); bzero (buf, 32); bcmp (buf, buf + 16, 16); return 0; } - -/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 15 } */ -/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */ -/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 16 } */ -/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 16 } */ -/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 18 } */ -/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 6 } */ -/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 20 } */ -/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 7 } */ diff --git a/gcc/testsuite/gcc.dg/pch/counter-2.c b/gcc/testsuite/gcc.dg/pch/counter-2.c index 14ce249..c0d25bf 100644 --- a/gcc/testsuite/gcc.dg/pch/counter-2.c +++ b/gcc/testsuite/gcc.dg/pch/counter-2.c @@ -9,7 +9,7 @@ #include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */ /* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 0 } */ -/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */ +/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } .-2 } */ /* { dg-message "terminated" "" { target *-*-* } 0 } */ int main(void) diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c index e916b93..e9d98f4 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c @@ -30,7 +30,7 @@ test_stringized_token_2 (int x) } while (0) EXAMPLE(x > 0, 1, 1, 6); - /* { dg-error "unable to read substring location: cpp_interpret_string_1 failed" "" { target *-*-* } 28 } */ + /* { dg-error "unable to read substring location: cpp_interpret_string_1 failed" "" { target *-*-* } .-5 } */ #undef EXAMPLE } diff --git a/gcc/testsuite/gcc.dg/pr27528.c b/gcc/testsuite/gcc.dg/pr27528.c index 4f33a31..c9bb238 100644 --- a/gcc/testsuite/gcc.dg/pr27528.c +++ b/gcc/testsuite/gcc.dg/pr27528.c @@ -1,18 +1,23 @@ /* Check the warnings and errors generated for asm operands that aren't obviously constant but that are constrained to be constants. */ /* { dg-options "" } */ -/* { dg-error "impossible constraint" "" { target *-*-* } 13 } */ -/* { dg-error "impossible constraint" "" { target *-*-* } 14 } */ -/* { dg-error "impossible constraint" "" { target *-*-* } 15 } */ -/* { dg-error "impossible constraint" "" { target *-*-* } 16 } */ + int bar (int); void foo (int *x, int y) { int constant = 0; asm ("# %0" :: "i" (x)); /* { dg-warning "probably doesn't match" } */ + /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */ + asm ("# %0" :: "i" (bar (*x))); /* { dg-warning "probably doesn't match" } */ + /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */ + asm ("# %0" :: "i" (*x + 0x11)); /* { dg-warning "probably doesn't match" } */ + /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */ + asm ("# %0" :: "i" (constant)); /* { dg-warning "probably doesn't match" } */ + /* { dg-error "impossible constraint" "" { target *-*-* } .-1 } */ + asm ("# %0" :: "i" (y * 0)); /* folded */ } diff --git a/gcc/testsuite/gcc.dg/pr27953.c b/gcc/testsuite/gcc.dg/pr27953.c index 74fd5dd..99ae0a3 100644 --- a/gcc/testsuite/gcc.dg/pr27953.c +++ b/gcc/testsuite/gcc.dg/pr27953.c @@ -1,7 +1,9 @@ /* PR c/27953 */ -void foo(struct A a) {} /* { dg-warning "declared inside parameter list" "inside" } */ -/* { dg-error "incomplete type" "incomplete" { target *-*-* } .-1 } */ +void foo(struct A a) {} /* { dg-line foo_first } */ +/* { dg-warning "declared inside parameter list" "inside" { target *-*-* } .-1 } */ +/* { dg-error "incomplete type" "incomplete" { target *-*-* } .-2 } */ -void foo() {} /* { dg-error "redefinition" "redef" } */ -/* { dg-message "note: previous definition" "previous" { target *-*-* } 3 } */ +void foo() {} +/* { dg-error "redefinition" "redef" { target *-*-* } .-1 } */ +/* { dg-message "note: previous definition" "previous" { target *-*-* } foo_first } */ diff --git a/gcc/testsuite/gcc.dg/pr35899.c b/gcc/testsuite/gcc.dg/pr35899.c index 7bfb53f..5361582 100644 --- a/gcc/testsuite/gcc.dg/pr35899.c +++ b/gcc/testsuite/gcc.dg/pr35899.c @@ -5,13 +5,14 @@ int foo (void) { - int a = bar (); + int a = bar (); /* { dg-line bar_implicit_decl } */ return a; } void -bar (void) /* { dg-warning "conflicting types for" } */ +bar (void) +/* { dg-warning "conflicting types for" "" { target *-*-* } .-1 } */ +/* { dg-message "note: previous implicit declaration" "" { target *-*-* } bar_implicit_decl } */ { } -/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 8 } */ diff --git a/gcc/testsuite/gcc.dg/pr37561.c b/gcc/testsuite/gcc.dg/pr37561.c index 3ad8263..e73becc 100644 --- a/gcc/testsuite/gcc.dg/pr37561.c +++ b/gcc/testsuite/gcc.dg/pr37561.c @@ -8,16 +8,23 @@ void foo () { ((char *) p)++; /* { dg-error "lvalue" } */ + ((char *) q)++; /* { dg-error "lvalue" } */ + /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */ + ((char *) p)--; /* { dg-error "lvalue" } */ + ((char *) q)--; /* { dg-error "lvalue" } */ + /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */ + ++(char *) p; /* { dg-error "lvalue" } */ + ++(char *) q; /* { dg-error "lvalue" } */ + /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */ + --(char *) p; /* { dg-error "lvalue" } */ + --(char *) q; /* { dg-error "lvalue" } */ + /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */ } -/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 11 } */ -/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 13 } */ -/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 15 } */ -/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 17 } */ diff --git a/gcc/testsuite/gcc.dg/pr45461.c b/gcc/testsuite/gcc.dg/pr45461.c index 7f287bd..db86d86 100644 --- a/gcc/testsuite/gcc.dg/pr45461.c +++ b/gcc/testsuite/gcc.dg/pr45461.c @@ -9,10 +9,12 @@ foo (int i, ...) short e; va_list ap; va_start (ap, i); + e = va_arg (ap, short); /* { dg-warning "is promoted" "promoted" } */ + /* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } .-1 } */ + /* { dg-message "note: if this code" "if this code" {target *-*-* } .-2 } */ + va_end (ap); return e; } -/* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } 12 } */ -/* { dg-message "note: if this code" "if this code" {target *-*-* } 12 } */ diff --git a/gcc/testsuite/gcc.dg/pr45750.c b/gcc/testsuite/gcc.dg/pr45750.c index 22c471b..0359c61 100644 --- a/gcc/testsuite/gcc.dg/pr45750.c +++ b/gcc/testsuite/gcc.dg/pr45750.c @@ -11,6 +11,6 @@ int invalid[] = 0; /* { dg-error "invalid initializer" } */ void foo (void) { if (((struct S *)undeclared)->i); /* { dg-error "undeclared" } */ + /* { dg-message "reported only once" "" { target *-*-* } .-1 } */ } -/* { dg-message "reported only once" "" { target *-*-* } 13 } */ diff --git a/gcc/testsuite/gcc.dg/pr53196-2.c b/gcc/testsuite/gcc.dg/pr53196-2.c index efb6a82..1d47b86 100644 --- a/gcc/testsuite/gcc.dg/pr53196-2.c +++ b/gcc/testsuite/gcc.dg/pr53196-2.c @@ -8,9 +8,11 @@ struct foo { int i; }; int main () { - struct foo f = (struct foo_typo) { }; /* { dg-error "invalid use of undefined type" } */ + struct foo f = (struct foo_typo) { }; + /* { dg-error "invalid use of undefined type" "" { target *-*-* } .-1 } */ + /* { dg-error "ISO C forbids empty initializer braces" "" { target *-*-* } .-2 } */ + printf ("%d\n", f.i); return 0; } -/* { dg-error "ISO C forbids empty initializer braces" "" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/pr53265.c b/gcc/testsuite/gcc.dg/pr53265.c index ea39d69..d641822 100644 --- a/gcc/testsuite/gcc.dg/pr53265.c +++ b/gcc/testsuite/gcc.dg/pr53265.c @@ -86,11 +86,12 @@ fn7 (void) { int a[16], b, c; bar (a); - for (b = a[c = 0]; c < 16; b = a[++c]) /* { dg-warning "15 invokes undefined behavior" } */ + for (b = a[c = 0]; c < 16; b = a[++c]) + /* { dg-warning "15 invokes undefined behavior" "" { target *-*-* } .-1 } */ + /* { dg-message "note: within this loop" "" { target *-*-* } .-2 } */ baz (b); } -/* { dg-message "note: within this loop" "" { target *-*-* } 89 } */ const void *va, *vb, *vc, *vd, *ve; const void *vf[4]; diff --git a/gcc/testsuite/gcc.dg/redecl-1.c b/gcc/testsuite/gcc.dg/redecl-1.c index 1fb0070..a7ae0bd 100644 --- a/gcc/testsuite/gcc.dg/redecl-1.c +++ b/gcc/testsuite/gcc.dg/redecl-1.c @@ -52,13 +52,14 @@ void test3(void) void prime4(void) { - bar4(); /* { dg-warning "implicit declaration of function" "implicit" } */ + bar4(); /* { dg-line implicit_bar4 } */ + /* { dg-warning "implicit declaration of function" "implicit" { target *-*-* } implicit_bar4 } */ } void test4(void) { extern double bar4(double); /* { dg-error "conflict" } */ -/* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } 55 } */ +/* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } implicit_bar4 } */ } /* Implicit decl, clashing with extern at previous function scope. */ diff --git a/gcc/testsuite/gcc.dg/tls/thr-init-1.c b/gcc/testsuite/gcc.dg/tls/thr-init-1.c index eb2f846..a9b6061 100644 --- a/gcc/testsuite/gcc.dg/tls/thr-init-1.c +++ b/gcc/testsuite/gcc.dg/tls/thr-init-1.c @@ -2,7 +2,8 @@ /* { dg-require-effective-target tls } */ static __thread int fstat ; -static __thread int fstat = 1 ; +static __thread int fstat = 1 ; /* { dg-line fstat_prev } */ static __thread int fstat ; -static __thread int fstat = 2; /* { dg-error "redefinition of 'fstat'" } */ - /* { dg-message "note: previous definition of 'fstat' was here" "" { target *-*-* } 5 } */ +static __thread int fstat = 2; +/* { dg-error "redefinition of 'fstat'" "" { target *-*-* } .-1 } */ +/* { dg-message "note: previous definition of 'fstat' was here" "" { target *-*-* } fstat_prev } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-1.c b/gcc/testsuite/gcc.dg/torture/pr51106-1.c index 10b3b68..8a1227d 100644 --- a/gcc/testsuite/gcc.dg/torture/pr51106-1.c +++ b/gcc/testsuite/gcc.dg/torture/pr51106-1.c @@ -6,9 +6,9 @@ int foo (int x) { asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */ + /* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } .-1 } */ return 1; lab: return 0; } -/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 8 } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-2.c b/gcc/testsuite/gcc.dg/torture/pr51106-2.c index bab0987..4209553 100644 --- a/gcc/testsuite/gcc.dg/torture/pr51106-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr51106-2.c @@ -7,9 +7,9 @@ int bar (int x) { asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */ +/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } .-1 } */ __builtin_unreachable (); lab: return 0; } -/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 9 } */ diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c index aa1b3fb..094dc0e 100644 --- a/gcc/testsuite/gcc.dg/uninit-19.c +++ b/gcc/testsuite/gcc.dg/uninit-19.c @@ -11,7 +11,8 @@ fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4, unsigned char *c2, float *p10) { if (p1 & 8) - b[3] = p10[a]; /* 14. */ + b[3] = p10[a]; + /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } .-1 } */ } void @@ -20,8 +21,6 @@ fn2 () float *n; if (l & 6) n = &c + m; - fn1 (l, &d, &e, &g, &i, &h, &k, n); /* 23. */ + fn1 (l, &d, &e, &g, &i, &h, &k, n); + /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } .-1 } */ } - -/* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } 14 } */ -/* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } 23 } */ diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644.c b/gcc/testsuite/gcc.dg/uninit-pr20644.c index e13910b..a9a7324 100644 --- a/gcc/testsuite/gcc.dg/uninit-pr20644.c +++ b/gcc/testsuite/gcc.dg/uninit-pr20644.c @@ -16,9 +16,10 @@ int bar () { int i = 1; int j; + /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } .-1 } */ if (1 == i) - return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 18 } */ + return j; return 0; }