20031223-1.c: Add comments to check for multiple messages reported for one line of source code.

* gcc.dg/20031223-1.c: Add comments to check for multiple
	messages reported for one line of source code.
	* gcc.dg/Wconversion-integer.c: Likewise.
	* gcc.dg/Wfatal-2.c: Likewise.
	* gcc.dg/Wfatal.c: Likewise.
	* gcc.dg/Wobjsize-1.c: Likewise.
	* gcc.dg/c99-vla-jump-1.c: Likewise.
	* gcc.dg/c99-vla-jump-2.c: Likewise.
	* gcc.dg/c99-vla-jump-3.c: Likewise.
	* gcc.dg/c99-vla-jump-4.c: Likewise.
	* gcc.dg/c99-vla-jump-5.c: Likewise.
	* gcc.dg/decl-9.c: Likewise.
	* gcc.dg/declspec-10.c: Likewise.
	* gcc.dg/declspec-18.c: Likewise.
	* gcc.dg/mtune.c: Likewise.
	* gcc.dg/parser-pr28152-2.c: Likewise.
	* gcc.dg/parser-pr28152.c: Likewise.
	* gcc.dg/pr14475.c: Likewise.
	* gcc.dg/pr27953.c: Likewise.
	* gcc.dg/pr28322-3.c: Likewise.
	* gcc.dg/pr30457.c: Likewise.
	* gcc.dg/pr30551-2.c: Likewise.
	* gcc.dg/pr30551-3.c: Likewise.
	* gcc.dg/pr30551-4.c: Likewise.
	* gcc.dg/pr30551-5.c: Likewise.
	* gcc.dg/pr30551-6.c: Likewise.
	* gcc.dg/pr30551.c: Likewise.
	* gcc.dg/pr45461.c: Likewise.
	* gcc.dg/pr48552-1.c: Likewise.
	* gcc.dg/pr48552-2.c: Likewise.
	* gcc.dg/redecl-1.c: Likewise.
	* gcc.dg/transparent-union-3.c: Likewise.
	* gcc.dg/utf-dflt.c: Likewise.
	* gcc.dg/utf-dflt2.c: Likewise.
	* gcc.dg/vla-8.c: Likewise.
	* gcc.dg/vla-init-1.c: Likewise.
	* gcc.dg/wtr-int-type-1.c: Likewise.

From-SVN: r188478
This commit is contained in:
Janis Johnson 2012-06-12 20:25:16 +00:00 committed by Janis Johnson
parent 526d4b7279
commit 3eae54ca6e
37 changed files with 177 additions and 139 deletions

View File

@ -1,5 +1,43 @@
2012-06-12 Janis Johnson <janisjo@codesourcery.com> 2012-06-12 Janis Johnson <janisjo@codesourcery.com>
* gcc.dg/20031223-1.c: Add comments to check for multiple
messages reported for one line of source code.
* gcc.dg/Wconversion-integer.c: Likewise.
* gcc.dg/Wfatal-2.c: Likewise.
* gcc.dg/Wfatal.c: Likewise.
* gcc.dg/Wobjsize-1.c: Likewise.
* gcc.dg/c99-vla-jump-1.c: Likewise.
* gcc.dg/c99-vla-jump-2.c: Likewise.
* gcc.dg/c99-vla-jump-3.c: Likewise.
* gcc.dg/c99-vla-jump-4.c: Likewise.
* gcc.dg/c99-vla-jump-5.c: Likewise.
* gcc.dg/decl-9.c: Likewise.
* gcc.dg/declspec-10.c: Likewise.
* gcc.dg/declspec-18.c: Likewise.
* gcc.dg/mtune.c: Likewise.
* gcc.dg/parser-pr28152-2.c: Likewise.
* gcc.dg/parser-pr28152.c: Likewise.
* gcc.dg/pr14475.c: Likewise.
* gcc.dg/pr27953.c: Likewise.
* gcc.dg/pr28322-3.c: Likewise.
* gcc.dg/pr30457.c: Likewise.
* gcc.dg/pr30551-2.c: Likewise.
* gcc.dg/pr30551-3.c: Likewise.
* gcc.dg/pr30551-4.c: Likewise.
* gcc.dg/pr30551-5.c: Likewise.
* gcc.dg/pr30551-6.c: Likewise.
* gcc.dg/pr30551.c: Likewise.
* gcc.dg/pr45461.c: Likewise.
* gcc.dg/pr48552-1.c: Likewise.
* gcc.dg/pr48552-2.c: Likewise.
* gcc.dg/redecl-1.c: Likewise.
* gcc.dg/transparent-union-3.c: Likewise.
* gcc.dg/utf-dflt.c: Likewise.
* gcc.dg/utf-dflt2.c: Likewise.
* gcc.dg/vla-8.c: Likewise.
* gcc.dg/vla-init-1.c: Likewise.
* gcc.dg/wtr-int-type-1.c: Likewise.
* c-c++-common/raw-string-3.c: Add comments to checks for multiple * c-c++-common/raw-string-3.c: Add comments to checks for multiple
messages reported for for one line of source code. messages reported for for one line of source code.
* c-c++-common/raw-string-5.c: Likewise. * c-c++-common/raw-string-5.c: Likewise.

View File

@ -7,7 +7,7 @@
void f () void f ()
{ {
l: int; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" } */ l: int; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" "not stmt" } */
/* { dg-warning "useless type name in empty declaration" "" { target *-*-* } 10 } */ /* { dg-warning "useless type name in empty declaration" "type name" { target *-*-* } 10 } */
/* { dg-error "label at end of compound statement" "" { target *-*-* } 10 } */ /* { dg-error "label at end of compound statement" "label" { target *-*-* } 10 } */
} }

View File

@ -40,10 +40,10 @@ void h (int x)
fuc ('A'); fuc ('A');
uc = 'A'; uc = 'A';
uc = x ? 1U : -1; /* { dg-warning " conversion" } */ uc = x ? 1U : -1; /* { dg-warning " conversion" "conversion" } */
/* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 43 } */ /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 43 } */
uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" } */ uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" "conversion" } */
/* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 45 } */ /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 45 } */
uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */

View File

@ -5,5 +5,5 @@
int i = INT_MAX + 1; /* { dg-error "integer overflow in expression" } */ int i = INT_MAX + 1; /* { dg-error "integer overflow in expression" } */
int k = 1 / 0; int k = 1 / 0;
int j = INT_MIN - 1; int j = INT_MIN - 1;
/* { dg-message "being treated as errors" "" { target *-*-* } 0 } */ /* { dg-message "being treated as errors" "treated as errors" { target *-*-* } 0 } */
/* { dg-message "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */ /* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */

View File

@ -5,8 +5,8 @@
int i = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ int i = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
int k = 1 / 0; /* { dg-error "division by zero" } */ int k = 1 / 0; /* { dg-error "division by zero" } */
int j = INT_MIN - 1; int j = INT_MIN - 1;
/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ /* { dg-message "some warnings being treated as errors" "treated as errors" {target "*-*-*"} 0 } */
/* { dg-message "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */ /* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */

View File

@ -11,5 +11,5 @@ int main(int argc, char **argv)
} }
/* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 6 } */ /* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 6 } */
/* { dg-message "file included" "" { target *-*-* } 0 } */ /* { dg-message "file included" "included" { target *-*-* } 0 } */
/* { dg-message "inlined from" "" { target *-*-* } 0 } */ /* { dg-message "inlined from" "inlined" { target *-*-* } 0 } */

View File

@ -305,5 +305,5 @@ void fa287 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}
void fa288 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0;a: goto a; } void fa288 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0;a: goto a; }
/* Match extra informative notes. */ /* Match extra informative notes. */
/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */

View File

@ -305,5 +305,5 @@ void fb287 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:g
void fb288 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; } void fb288 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; }
/* Match extra informative notes. */ /* Match extra informative notes. */
/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */

View File

@ -305,5 +305,5 @@ void fc287 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef
void fc288 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0;a: goto a; } void fc288 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0;a: goto a; }
/* Match extra informative notes. */ /* Match extra informative notes. */
/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */

View File

@ -305,5 +305,5 @@ void fd287 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typede
void fd288 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; } void fd288 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; }
/* Match extra informative notes. */ /* Match extra informative notes. */
/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */

View File

@ -30,5 +30,5 @@ f (int a, int b)
} }
/* Match extra informative notes. */ /* Match extra informative notes. */
/* { dg-message "note: switch starts here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: switch starts here" "note: starts" { target *-*-* } 0 } */
/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */

View File

@ -21,7 +21,7 @@ int f2()
{ {
b: a: ; /* { dg-bogus "a label can only be part of a statement" } */ b: a: ; /* { dg-bogus "a label can only be part of a statement" } */
c: d e; /* { dg-error "a label can only be part of a statement" } */ c: d e; /* { dg-error "a label can only be part of a statement" } */
/* { dg-error "unknown type name 'd'" "" { target *-*-* } 23 } */ /* { dg-error "unknown type name 'd'" "unknown type name" { target *-*-* } 23 } */
; ;
} }

View File

@ -44,4 +44,4 @@ void i (void) { auto void y (void) {} } /* { dg-warning "ISO C forbids nested fu
inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */ inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */
/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */ /* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } 19 } */

View File

@ -5,7 +5,7 @@ static t1 *a; /* { dg-error "unknown type name 't1'" } */
int z; /* { dg-message "previous declaration of 'z'" } */ int z; /* { dg-message "previous declaration of 'z'" } */
typedef t2 *z; /* { dg-error "unknown type name 't2'" } */ typedef t2 *z; /* { dg-error "unknown type name 't2'" } */
/* { dg-error "'z' redeclared " "" { target *-*-* } 7 } */ /* { dg-error "'z' redeclared " "redeclared" { target *-*-* } 7 } */
extern t3 p1(void); /* { dg-error "unknown type name 't3'" } */ extern t3 p1(void); /* { dg-error "unknown type name 't3'" } */
int p2(const t4 x); /* { dg-error "unknown type name 't4'" } */ int p2(const t4 x); /* { dg-error "unknown type name 't4'" } */
@ -23,36 +23,36 @@ struct s {
}; };
typeof (z) c1; typeof (z) c1;
typeof (x1) c2; /* { dg-error "undeclared" } */ typeof (x1) c2; /* { dg-error "undeclared" "undeclared" } */
typeof (const t11) c3; /* { dg-error "unknown type name 't11'" } */ typeof (const t11) c3; /* { dg-error "unknown type name 't11'" } */
typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "" { xfail *-*-* } } */ typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } } */
/* { dg-bogus "unknown type name 'x1'" "" { target *-*-* } 26 } */ /* { dg-bogus "unknown type name 'x1'" unknown"" { target *-*-* } 26 } */
/* { dg-bogus "undeclared" "" { xfail *-*-* } 28 } */ /* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 28 } */
/* { dg-bogus "expected expression before" "" { xfail *-*-* } 28 } */ /* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 28 } */
int recover1; int recover1;
int s0 = sizeof (z); int s0 = sizeof (z);
int s1 = sizeof (x2); /* { dg-error "undeclared" } */ int s1 = sizeof (x2); /* { dg-error "undeclared" "undeclared" } */
int s2 = sizeof (const t13); /* { dg-error "unknown type name 't13'" } */ int s2 = sizeof (const t13); /* { dg-error "unknown type name 't13'" } */
int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "" { xfail *-*-* } } */ int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } } */
int recover2; int recover2;
/* { dg-bogus "unknown type name 'x2'" "" { target *-*-* } 36 } */ /* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } 36 } */
/* { dg-bogus "undeclared" "" { xfail *-*-* } 38 } */ /* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 38 } */
/* { dg-bogus "expected expression before" "" { xfail *-*-* } 38 } */ /* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 38 } */
int a0 = __alignof__ (z); int a0 = __alignof__ (z);
int a1 = __alignof__ (x3); /* { dg-error "undeclared" } */ int a1 = __alignof__ (x3); /* { dg-error "undeclared" } */
int a2 = __alignof__ (const t15); /* { dg-error "unknown type name 't15'" } */ int a2 = __alignof__ (const t15); /* { dg-error "unknown type name 't15'" } */
int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "" { xfail *-*-* } } */ int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } } */
int recover3; int recover3;
/* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } 47 } */ /* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } 47 } */
/* { dg-bogus "undeclared" "" { xfail *-*-* } 49 } */ /* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 49 } */
/* { dg-bogus "expected expression before" "" { xfail *-*-* } 49 } */ /* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 49 } */
/* Cannot detect (undefd_type *) or (undefd_type (*) because it would /* Cannot detect (undefd_type *) or (undefd_type (*) because it would
@ -60,14 +60,14 @@ int recover3;
const char *f1() const char *f1()
{ {
return (const t17) "abc"; /* { dg-error "unknown type name 't17'" } */ return (const t17) "abc"; /* { dg-error "unknown type name 't17'" "t17" } */
/* { dg-bogus "expected" "" { target *-*-* } 63 } */ /* { dg-bogus "expected" "expected" { target *-*-* } 63 } */
} }
const char *f2() const char *f2()
{ {
return (const t18 *) "abc"; /* { dg-error "unknown type name 't18'" } */ return (const t18 *) "abc"; /* { dg-error "unknown type name 't18'" "t18" } */
/* { dg-bogus "expected" "" { target *-*-* } 69 } */ /* { dg-bogus "expected" "expected" { target *-*-* } 69 } */
} }
@ -76,15 +76,15 @@ const char *f2()
void *f3(int x) void *f3(int x)
{ {
return (void *) ((void *(*)(t19)) f3); /* { dg-error "unknown type name 't19'" } */ return (void *) ((void *(*)(t19)) f3); /* { dg-error "unknown type name 't19'" "t19" } */
/* { dg-bogus "expected" "" { xfail *-*-* } 79 } */ /* { dg-bogus "expected" "expected" { xfail *-*-* } 79 } */
} }
const void *f4() const void *f4()
{ {
return &((const t20){1}); /* { dg-error "unknown type name 't20'" } */ return &((const t20){1}); /* { dg-error "unknown type name 't20'" } */
/* { dg-bogus "return discards 'const'" "" { target *-*-* } 85 } */ /* { dg-bogus "return discards 'const'" "discards" { target *-*-* } 85 } */
/* { dg-bogus "expected" "" { target *-*-* } 85 } */ /* { dg-bogus "expected" "expected" { target *-*-* } 85 } */
} }
int f5(__builtin_va_list ap) int f5(__builtin_va_list ap)
@ -95,6 +95,6 @@ int f5(__builtin_va_list ap)
int f6(void) int f6(void)
{ {
return __builtin_offsetof (t23, field); /* { dg-error "unknown type name 't23'" } */ return __builtin_offsetof (t23, field); /* { dg-error "unknown type name 't23'" "t23" } */
/* { dg-bogus "request for member" "" { target *-*-* } 98 } */ /* { dg-bogus "request for member" "request" { target *-*-* } 98 } */
} }

View File

@ -1,8 +1,8 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-mtune=*" } { "" } } */ /* { dg-skip-if "" { *-*-* } { "-mtune=*" } { "" } } */
/* { dg-options "-mtune=foo" } */ /* { dg-options "-mtune=foo" } */
/* { dg-error "mtune" "" { target *-*-* } 0 } */ /* { dg-error "mtune" "mtune" { target *-*-* } 0 } */
/* { dg-bogus "march" "" { target *-*-* } 0 } */ /* { dg-bogus "march" "march" { target *-*-* } 0 } */
/* { dg-bogus "mcpu" "" { target *-*-* } 0 } */ /* { dg-bogus "mcpu" "mcpu" { target *-*-* } 0 } */
/* { dg-prune-output "note: valid arguments.*" } */ /* { dg-prune-output "note: valid arguments.*" } */
int i; int i;

View File

@ -7,5 +7,5 @@ main (void)
__complex__ float z; __complex__ float z;
z = __complex__ (1.90000007326203904e+19, 0.0); /* { dg-error "__complex__" } */ z = __complex__ (1.90000007326203904e+19, 0.0); /* { dg-error "__complex__" } */
z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" } */ z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" "Complex" } */
/* { dg-error "at end of input" "" { target *-*-* } 10 } */ /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */

View File

@ -7,5 +7,5 @@ main (void)
_Complex float z; _Complex float z;
z = _Complex (1.90000007326203904e+19, 0.0); /* { dg-error "_Complex" } */ z = _Complex (1.90000007326203904e+19, 0.0); /* { dg-error "_Complex" } */
z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" } */ z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" "_Complex" } */
/* { dg-error "at end of input" "" { target *-*-* } 10 } */ /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */

View File

@ -3,8 +3,8 @@
struct tree_common struct tree_common
{ {
enum tree_code code : 8; /* { dg-error "ISO C forbids forward references to" "" } */ enum tree_code code : 8; /* { dg-error "ISO C forbids forward references to" "forward ref" } */
/* { dg-error "type of bit-field .code. is a GCC extension" "" { target *-*-* } 6 } */ /* { dg-error "type of bit-field .code. is a GCC extension" "extension" { target *-*-* } 6 } */
/* { dg-warning "narrower than values of its type" "" { target *-*-* } 6 } */ /* { dg-warning "narrower than values of its type" "narrower" { target *-*-* } 6 } */
/* { dg-error "incomplete type" "" { target *-*-* } 6 } */ /* { dg-error "incomplete type" "incomplete" { target *-*-* } 6 } */
}; };

View File

@ -1,8 +1,8 @@
/* PR c/27953 */ /* PR c/27953 */
void foo(struct A a) {} /* { dg-warning "declared inside parameter list" } */ void foo(struct A a) {} /* { dg-warning "declared inside parameter list" "inside" } */
/* { dg-warning "its scope is only" "" { target *-*-* } 3 } */ /* { dg-warning "its scope is only" "scope" { target *-*-* } 3 } */
/* { dg-error "incomplete type" "" { target *-*-* } 3 } */ /* { dg-error "incomplete type" "incomplete" { target *-*-* } 3 } */
void foo() {} /* { dg-error "redefinition" } */ void foo() {} /* { dg-error "redefinition" "redef" } */
/* { dg-message "note: previous definition" "" { target *-*-* } 3 } */ /* { dg-message "note: previous definition" "previous" { target *-*-* } 3 } */

View File

@ -6,5 +6,5 @@ void foo(void)
{ {
int i = 1; int i = 1;
} }
/* { dg-message "unrecognized command line option .-fno-foobar." "" { target *-*-* } 0 } */ /* { dg-message "unrecognized command line option .-fno-foobar." "f" { target *-*-* } 0 } */
/* { dg-message "unrecognized command line option .-mno-foobar." "" { target *-*-* } 0 } */ /* { dg-message "unrecognized command line option .-mno-foobar." "m" { target *-*-* } 0 } */

View File

@ -17,9 +17,9 @@ void foo(register short paramN, ...)
va_start(ap, paramN); /* { dg-warning "undefined behaviour when second parameter of 'va_start' is declared with 'register' storage" } */ va_start(ap, paramN); /* { dg-warning "undefined behaviour when second parameter of 'va_start' is declared with 'register' storage" } */
/* Undefined by C99 7.15.1.1p2: */ /* Undefined by C99 7.15.1.1p2: */
(void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" } */ (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" "promoted" } */
/* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "" { target *-*-* } 20 } */ /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "int not char" { target *-*-* } 20 } */
/* { dg-message "note: if this code is reached, the program will abort" "" { target *-*-* } 20 } */ /* { dg-message "note: if this code is reached, the program will abort" "will abort" { target *-*-* } 20 } */
va_end(ap); va_end(ap);
} }

View File

@ -2,7 +2,7 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "" } */ /* { dg-options "" } */
void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */ void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */ /* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */

View File

@ -2,6 +2,6 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-pedantic-errors" } */ /* { dg-options "-pedantic-errors" } */
/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */ /* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
void main(char a) {} /* { dg-error "first argument of .main. should be .int." } */ void main(char a) {} /* { dg-error "first argument of .main. should be .int." "int" } */
/* { dg-error ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-error ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
/* { dg-error "return type of .main. is not .int." "" { target *-*-* } 5 } */ /* { dg-error "return type of .main. is not .int." "return type" { target *-*-* } 5 } */

View File

@ -2,7 +2,7 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-pedantic-errors -Wno-main" } */ /* { dg-options "-pedantic-errors -Wno-main" } */
void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */ void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */ /* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */

View File

@ -2,6 +2,6 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-pedantic -Wno-main" } */ /* { dg-options "-pedantic -Wno-main" } */
void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */ void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */ /* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */

View File

@ -2,6 +2,6 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-pedantic" } */ /* { dg-options "-pedantic" } */
/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */ /* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */ void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */
/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */ /* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */

View File

@ -2,6 +2,6 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Wall" } */ /* { dg-options "-Wall" } */
/* { dg-skip-if "-Wmain not enabled with -Wall on SPU" { spu-*-* } } */ /* { dg-skip-if "-Wmain not enabled with -Wall on SPU" { spu-*-* } } */
void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */ void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */
/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ /* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */ /* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */

View File

@ -9,10 +9,10 @@ foo (int i, ...)
short e; short e;
va_list ap; va_list ap;
va_start (ap, i); va_start (ap, i);
e = va_arg (ap, short); /* { dg-warning "is promoted" } */ e = va_arg (ap, short); /* { dg-warning "is promoted" "promoted" } */
va_end (ap); va_end (ap);
return e; return e;
} }
/* { dg-message "note: \\(so you should pass" "" {target *-*-* } 12 } */ /* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } 12 } */
/* { dg-message "note: if this code" "" {target *-*-* } 12 } */ /* { dg-message "note: if this code" "if this code" {target *-*-* } 12 } */

View File

@ -7,15 +7,15 @@ struct S;
void void
f1 (void *x) f1 (void *x)
{ {
__asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */ __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */
void void
f2 (void *x) f2 (void *x)
{ {
__asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */ __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
/* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
void void
f3 (void *x) f3 (void *x)
{ {
@ -31,15 +31,15 @@ f4 (void *x)
void void
f5 (void *x) f5 (void *x)
{ {
__asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */ __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */
void void
f6 (void *x) f6 (void *x)
{ {
__asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */ __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
/* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
void void
f7 (struct S *x) f7 (struct S *x)
{ {
@ -49,5 +49,5 @@ f7 (struct S *x)
void void
f8 (struct S *x) f8 (struct S *x)
{ {
__asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */ } /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */

View File

@ -7,15 +7,15 @@ struct S;
void void
f1 (void *x) f1 (void *x)
{ {
__asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */ __asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */
void void
f2 (void *x) f2 (void *x)
{ {
__asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */ __asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
/* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
void void
f3 (void *x) f3 (void *x)
{ {
@ -31,15 +31,15 @@ f4 (void *x)
void void
f5 (void *x) f5 (void *x)
{ {
__asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */ __asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */
void void
f6 (void *x) f6 (void *x)
{ {
__asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */ __asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */
} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */ } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
/* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
void void
f7 (struct S *x) f7 (struct S *x)
{ {
@ -49,5 +49,5 @@ f7 (struct S *x)
void void
f8 (struct S *x) f8 (struct S *x)
{ {
__asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ __asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */ } /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */

View File

@ -52,21 +52,21 @@ void test3(void)
void prime4(void) void prime4(void)
{ {
bar4(); /* { dg-warning "implicit declaration of function" } */ bar4(); /* { dg-warning "implicit declaration of function" "implicit" } */
} }
void test4(void) void test4(void)
{ {
extern double bar4(double); /* { dg-error "conflict" } */ extern double bar4(double); /* { dg-error "conflict" } */
/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 55 } */ /* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } 55 } */
} }
/* Implicit decl, clashing with extern at previous function scope. */ /* Implicit decl, clashing with extern at previous function scope. */
void prime5(void) void prime5(void)
{ {
extern double bar5(double); /* { dg-message "note: previous declaration" "" } */ extern double bar5(double); /* { dg-message "note: previous declaration" "previous 1" } */
} /* { dg-message "note: previous implicit declaration" "" { target *-*-* } 68 } */ } /* { dg-message "note: previous implicit declaration" "previous 2" { target *-*-* } 68 } */
void test5(void) void test5(void)
{ {

View File

@ -6,15 +6,15 @@
enum e { A }; enum e { A };
union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" } */ union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 9 } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 9 } */
union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" } */ union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "not anything" } */
/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 11 } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 11 } */
union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" } */ union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 14 } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 14 } */
union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" } */ union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "no anything" } */
/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 16 } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 16 } */
union __attribute__((__transparent_union__)) u1 { }; union __attribute__((__transparent_union__)) u1 { };
/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 19 } */ /* { dg-warning "union cannot be made transparent" "" { target *-*-* } 19 } */

View File

@ -3,10 +3,10 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "" } */ /* { dg-options "" } */
const unsigned short c0 = u'a'; /* { dg-error "undeclared" } */ const unsigned short c0 = u'a'; /* { dg-error "undeclared" "undeclared" } */
/* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 6 } */
const unsigned long c1 = U'a'; /* { dg-error "undeclared" } */ const unsigned long c1 = U'a'; /* { dg-error "undeclared" "undeclared" } */
/* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 8 } */
#define u 1 + #define u 1 +
#define U 2 + #define U 2 +

View File

@ -2,8 +2,8 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "" } */ /* { dg-options "" } */
const void *s0 = u8"a"; /* { dg-error "undeclared" } */ const void *s0 = u8"a"; /* { dg-error "undeclared" "undeclared" } */
/* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 5 } */
#define u8 "a" #define u8 "a"

View File

@ -30,5 +30,5 @@ void foo2(int n) {
} }
/* Match extra informative notes. */ /* Match extra informative notes. */
/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: label '\[^\n'\]*' defined here" "defined" { target *-*-* } 0 } */
/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ /* { dg-message "note: '\[^\n'\]*' declared here" "declared" { target *-*-* } 0 } */

View File

@ -10,6 +10,6 @@ void
foo (void) foo (void)
{ {
int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */ int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */
/* { dg-warning "excess elements in array initializer" "" { target *-*-* } 12 } */ /* { dg-warning "excess elements in array initializer" "excess" { target *-*-* } 12 } */
/* { dg-warning "near initialization" "" { target *-*-* } 12 } */ /* { dg-warning "near initialization" "near" { target *-*-* } 12 } */
} }

View File

@ -25,8 +25,8 @@ testfunc ()
/* But this one should, since it doesn't fit in long (long), but /* But this one should, since it doesn't fit in long (long), but
does fit in unsigned long (long). */ does fit in unsigned long (long). */
i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "decimal constant" } */ i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "so large" } */
/* { dg-warning "this decimal constant would be unsigned in ISO C90" "decimal constant" { target *-*-* } 28 } */ /* { dg-warning "this decimal constant would be unsigned in ISO C90" "ISO C90" { target *-*-* } 28 } */
# 29 "sys-header.h" 3 # 29 "sys-header.h" 3
} }