diff options
Diffstat (limited to 'gcc/testsuite')
29 files changed, 316 insertions, 221 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7801d77376..62b77f61e49 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,45 @@ +2009-06-12 Aldy Hernandez <aldyh@redhat.com> + + * gcc.dg/old-style-prom-3.c: Add column info. + * gcc.dg/overflow-warn-1.c + * gcc.dg/gomp/pr27415.c + * gcc.dg/gomp/for-1.c: Same. + * gcc.dg/enum-compat-1.c: Same. + * gcc.dg/c99-tag-3.c: Same. + * gcc.dg/Wredundant-decls-2.c: Same. + * gcc.dg/func-ptr-conv-1.c: Same. + * gcc.dg/asm-wide-1.c: Same. + * gcc.dg/nofixed-point-2.c: Same. + * gcc.dg/cpp/line3.c: Same. + * gcc.dg/array-10.c: Same. + * gcc.dg/c99-vla-jump-1.c: Same. + * gcc.dg/pr20368-1.c: Same. + * gcc.dg/Wshadow-3.c: Same. + * gcc.dg/c90-const-expr-8.c: Same. + * gcc.dg/label-decl-2.c: Same. + * gcc.dg/dremf-type-compat-2.c: Same. + * gcc.dg/c90-const-expr-5.c: Same. + * gcc.dg/builtins-30.c: Same. + * gcc.dg/Warray-bounds.c: Same. + * gcc.dg/Wcxx-compat-2.c: Same. + * gcc.dg/tree-ssa/col-1.c: Same. + * gcc.dg/old-style-prom-2.c: Same. + * gcc.dg/cast-function-1.c: Same. + * gcc.dg/pr15698-1.c: Same. + * gcc.dg/dremf-type-compat-3.c: Same. + * gcc.dg/vla-8.c: Same. + * gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct + line. + * gcc.dg/label-decl-2.c: Move label diagnostic to correct line. + * gcc.dg/old-style-prom-3.c: Check for error on the correct line. + * gcc.dg/enum-compat-1.c: Same. + * gcc.dg/dremf-type-compat-2.c: Same. + * gcc.dg/old-style-prom-2.c: Same. + * gcc.dg/pr15698-1.c: Same. + * gcc.dg/pr20368-1.c: Same. + * gcc.dg/dremf-type-compat-3.c: Same. + * gcc.dg/builtins-30.c: Same. Test for columns. + 2009-06-12 Janus Weil <janus@gcc.gnu.org> PR fortran/40176 diff --git a/gcc/testsuite/gcc.dg/Warray-bounds.c b/gcc/testsuite/gcc.dg/Warray-bounds.c index ac384e6bb2f..44120392c73 100644 --- a/gcc/testsuite/gcc.dg/Warray-bounds.c +++ b/gcc/testsuite/gcc.dg/Warray-bounds.c @@ -18,40 +18,40 @@ int* f(void) { int c[10]; } c; - a[-1] = 0; /* { dg-warning "array subscript" } */ + a[-1] = 0; /* { dg-warning "6:array subscript" } */ a[ 0] = 0; a[ 1] = 0; a[ 9] = 0; - a[10] = 0; /* { dg-warning "array subscript" } */ - a[11] = 0; /* { dg-warning "array subscript" } */ - a[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */ + a[10] = 0; /* { dg-warning "6:array subscript" } */ + a[11] = 0; /* { dg-warning "6:array subscript" } */ + a[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */ a[2 * n() - 10] = 1; a[2 * n() - 1] = 1; - a[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */ + a[2 * n() - 0] = 1; /* { dg-warning "6:array subscript" } */ - b[-1] = 0; /* { dg-warning "array subscript" } */ + b[-1] = 0; /* { dg-warning "6:array subscript" } */ b[ 0] = 0; b[ 1] = 0; b[ 9] = 0; - b[10] = 0; /* { dg-warning "array subscript" } */ - b[11] = 0; /* { dg-warning "array subscript" } */ - b[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */ + b[10] = 0; /* { dg-warning "6:array subscript" } */ + b[11] = 0; /* { dg-warning "6:array subscript" } */ + b[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */ b[2 * n() - 10] = 1; b[2 * n() - 1] = 1; b[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */ - c.c[-1] = 0; /* { dg-warning "array subscript" } */ + c.c[-1] = 0; /* { dg-warning "8:array subscript" } */ c.c[ 0] = 0; c.c[ 1] = 0; c.c[ 9] = 0; - c.c[10] = 0; /* { dg-warning "array subscript" } */ - c.c[11] = 0; /* { dg-warning "array subscript" } */ - c.c[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */ + c.c[10] = 0; /* { dg-warning "8:array subscript" } */ + c.c[11] = 0; /* { dg-warning "8:array subscript" } */ + c.c[2 * n() - 11] = 1; /* { dg-warning "8:array subscript" } */ c.c[2 * n() - 10] = 1; c.c[2 * n() - 1] = 1; - c.c[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */ + c.c[2 * n() - 0] = 1; /* { dg-warning "8:array subscript" } */ g(&a[8]); g(&a[9]); @@ -86,7 +86,7 @@ int* f(void) { c.c[-1] = 0; for (i = 20; i < 30; ++i) - a[i] = 1; /* { dg-warning "array subscript" } */ + a[i] = 1; /* { dg-warning "15:array subscript" } */ return a; } diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c index a091c6dd8b5..14edc1a4215 100644 --- a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c @@ -1,36 +1,36 @@ /* { dg-options "-Wc++-compat" } */ _Bool foo; /* This is okay. */ -int bool; /* { dg-warning "keyword" } */ -int catch; /* { dg-warning "keyword" } */ -int char16_t; /* { dg-warning "keyword" } */ -int char32_t; /* { dg-warning "keyword" } */ -int class; /* { dg-warning "keyword" } */ -int const_cast; /* { dg-warning "keyword" } */ -int decltype; /* { dg-warning "keyword" } */ -int delete; /* { dg-warning "keyword" } */ -int dynamic_cast; /* { dg-warning "keyword" } */ -int explicit; /* { dg-warning "keyword" } */ -int export; /* { dg-warning "keyword" } */ -int false; /* { dg-warning "keyword" } */ -int friend; /* { dg-warning "keyword" } */ -int mutable; /* { dg-warning "keyword" } */ -int namespace; /* { dg-warning "keyword" } */ -int new; /* { dg-warning "keyword" } */ -int operator; /* { dg-warning "keyword" } */ -int private; /* { dg-warning "keyword" } */ -int protected; /* { dg-warning "keyword" } */ -int public; /* { dg-warning "keyword" } */ -int reinterpret_cast; /* { dg-warning "keyword" } */ -int static_assert; /* { dg-warning "keyword" } */ -int static_cast; /* { dg-warning "keyword" } */ -int template; /* { dg-warning "keyword" } */ -int this; /* { dg-warning "keyword" } */ -int throw; /* { dg-warning "keyword" } */ -int true; /* { dg-warning "keyword" } */ -int try; /* { dg-warning "keyword" } */ -int typename; /* { dg-warning "keyword" } */ -int typeid; /* { dg-warning "keyword" } */ -int using; /* { dg-warning "keyword" } */ -int virtual; /* { dg-warning "keyword" } */ +int bool; /* { dg-warning "5:keyword" } */ +int catch; /* { dg-warning "5:keyword" } */ +int char16_t; /* { dg-warning "5:keyword" } */ +int char32_t; /* { dg-warning "5:keyword" } */ +int class; /* { dg-warning "5:keyword" } */ +int const_cast; /* { dg-warning "5:keyword" } */ +int decltype; /* { dg-warning "5:keyword" } */ +int delete; /* { dg-warning "5:keyword" } */ +int dynamic_cast; /* { dg-warning "5:keyword" } */ +int explicit; /* { dg-warning "5:keyword" } */ +int export; /* { dg-warning "5:keyword" } */ +int false; /* { dg-warning "5:keyword" } */ +int friend; /* { dg-warning "5:keyword" } */ +int mutable; /* { dg-warning "5:keyword" } */ +int namespace; /* { dg-warning "5:keyword" } */ +int new; /* { dg-warning "5:keyword" } */ +int operator; /* { dg-warning "5:keyword" } */ +int private; /* { dg-warning "5:keyword" } */ +int protected; /* { dg-warning "5:keyword" } */ +int public; /* { dg-warning "5:keyword" } */ +int reinterpret_cast; /* { dg-warning "5:keyword" } */ +int static_assert; /* { dg-warning "5:keyword" } */ +int static_cast; /* { dg-warning "5:keyword" } */ +int template; /* { dg-warning "5:keyword" } */ +int this; /* { dg-warning "5:keyword" } */ +int throw; /* { dg-warning "5:keyword" } */ +int true; /* { dg-warning "5:keyword" } */ +int try; /* { dg-warning "5:keyword" } */ +int typename; /* { dg-warning "5:keyword" } */ +int typeid; /* { dg-warning "5:keyword" } */ +int using; /* { dg-warning "5:keyword" } */ +int virtual; /* { dg-warning "5:keyword" } */ int wchar_t; diff --git a/gcc/testsuite/gcc.dg/Wredundant-decls-2.c b/gcc/testsuite/gcc.dg/Wredundant-decls-2.c index 89f57b427c6..27c8e5d9f7d 100644 --- a/gcc/testsuite/gcc.dg/Wredundant-decls-2.c +++ b/gcc/testsuite/gcc.dg/Wredundant-decls-2.c @@ -2,22 +2,22 @@ /* { dg-do compile } */ /* { dg-options "-Wredundant-decls" } */ -int j = 5; /* { dg-message "note: previous" } */ -int j; /* { dg-warning "redundant" } */ +int j = 5; /* { dg-message "5:note: previous" } */ +int j; /* { dg-warning "5:redundant" } */ static int k; -static int k = 5; /* { dg-message "note: previous" } */ -static int k; /* { dg-warning "redundant" } */ +static int k = 5; /* { dg-message "12:note: previous" } */ +static int k; /* { dg-warning "12:redundant" } */ -static int l = 5; /* { dg-message "note: previous" } */ -static int l; /* { dg-warning "redundant" } */ +static int l = 5; /* { dg-message "12:note: previous" } */ +static int l; /* { dg-warning "12:redundant" } */ -static int m; /* { dg-message "note: previous" } */ -static int m; /* { dg-warning "redundant" } */ +static int m; /* { dg-message "12:note: previous" } */ +static int m; /* { dg-warning "12:redundant" } */ static int m = 5; -int n; /* { dg-message "note: previous" } */ -int n; /* { dg-warning "redundant" } */ +int n; /* { dg-message "5:note: previous" } */ +int n; /* { dg-warning "5:redundant" } */ int n = 5; static int o; diff --git a/gcc/testsuite/gcc.dg/Wshadow-3.c b/gcc/testsuite/gcc.dg/Wshadow-3.c index a7f06a26f96..b6d78b1d38b 100644 --- a/gcc/testsuite/gcc.dg/Wshadow-3.c +++ b/gcc/testsuite/gcc.dg/Wshadow-3.c @@ -1,21 +1,61 @@ -/* Test warnings for shadowing in function prototype scope: generally - useless but of use if the parameter is used within the scope. Bug - 529. */ -/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* PR middle-end/36902 Array bound warning with dead code after optimization */ /* { dg-do compile } */ -/* { dg-options "-std=gnu89 -Wshadow" } */ - -int v; /* { dg-warning "shadowed declaration" } */ -int f1(int v); -int f2(int v, int x[v]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f3(int v, int y[sizeof(v)]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f4(int v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f5(int v, int x[v]) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f6(int x) { return 0; } -int f7(v) int v; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f8(v, w) int v; int w[v]; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f9(x) int x; { return 0; } -int f10(v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */ -int f11(int a, int b(int a)); -int f12(int a, int b(int a, int x[a])); /* { dg-warning "declaration of 'a' shadows a parameter" } */ -/* { dg-warning "shadowed declaration" "outer parm" { target *-*-* } 20 } */ +/* { dg-options "-O2 -Warray-bounds -Wall -Wextra" } */ +typedef unsigned char __u8; +typedef unsigned short __u16; + +static inline unsigned char * +foo(unsigned char * to, const unsigned char * from, int n) +{ + switch ( n ) + { + case 3: + *to = *from; + break; + case 5: + to[4] = from [4]; + break; + } + return to; +} + +struct { + int size_of_select; + unsigned char pcr_select[4]; +} sel; + +int bar(void) +{ + static unsigned char buf[64]; + + sel.size_of_select = 3; + foo(buf, sel.pcr_select, sel.size_of_select); + + return 1; +} + + +static inline unsigned char * +foo2(unsigned char * to, const unsigned char * from, int n) +{ + switch ( n ) + { + case 3: + *to = *from; + break; + case 5: + to[63] = from [111]; /* { dg-warning "array subscript is above array bounds" } */ + break; + } + return to; +} + +int baz(void) +{ + static unsigned char buf[64]; + + sel.size_of_select = 5; + foo2(buf, sel.pcr_select, sel.size_of_select); + + return 1; +} diff --git a/gcc/testsuite/gcc.dg/array-10.c b/gcc/testsuite/gcc.dg/array-10.c index aab1538d5e1..3b4d512ba5a 100644 --- a/gcc/testsuite/gcc.dg/array-10.c +++ b/gcc/testsuite/gcc.dg/array-10.c @@ -6,28 +6,28 @@ int a; -int b0[a]; /* { dg-error "at file scope" } */ -int (*b1)[a]; /* { dg-error "at file scope" } */ +int b0[a]; /* { dg-error "5:at file scope" } */ +int (*b1)[a]; /* { dg-error "7:at file scope" } */ int (*b2())[a]; /* { dg-error "at file scope" } */ -struct b3 { int x[a]; }; /* { dg-error "at file scope" } */ -struct b4 { int (*x)[a]; }; /* { dg-error "at file scope" } */ +struct b3 { int x[a]; }; /* { dg-error "17:at file scope" } */ +struct b4 { int (*x)[a]; }; /* { dg-error "19:at file scope" } */ typeof (int [a]) b5; /* { dg-error "at file scope|outside of any function" } */ -int c0[(__SIZE_TYPE__)&a]; /* { dg-error "at file scope" } */ -int (*c1)[(__SIZE_TYPE__)&a]; /* { dg-error "at file scope" } */ -int (*c2())[(__SIZE_TYPE__)&a]; /* { dg-error "at file scope" } */ -struct c3 { int x[(__SIZE_TYPE__)&a]; }; /* { dg-error "at file scope" } */ -struct c4 { int (*x)[(__SIZE_TYPE__)&a]; }; /* { dg-error "at file scope" } */ -typeof (int [(__SIZE_TYPE__)&a]) c5; /* { dg-error "at file scope" } */ +int c0[(__SIZE_TYPE__)&a]; /* { dg-error "5:at file scope" } */ +int (*c1)[(__SIZE_TYPE__)&a]; /* { dg-error "7:at file scope" } */ +int (*c2())[(__SIZE_TYPE__)&a]; /* { dg-error "7:at file scope" } */ +struct c3 { int x[(__SIZE_TYPE__)&a]; }; /* { dg-error "17:at file scope" } */ +struct c4 { int (*x)[(__SIZE_TYPE__)&a]; }; /* { dg-error "19:at file scope" } */ +typeof (int [(__SIZE_TYPE__)&a]) c5; /* { dg-error "34:at file scope" } */ -int d0[1/0]; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 23 } */ -int (*d1)[1/0]; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 25 } */ -int (*d2())[1/0]; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 27 } */ -struct d3 { int x[1/0]; }; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 29 } */ -struct d4 { int (*x)[1/0]; }; /* { dg-error "at file scope" } */ -/* { dg-warning "division by zero" "" { target *-*-* } 31 } */ -typeof (int [1/0]) d5; /* { dg-error "at file scope" } */ +int d0[1/0]; /* { dg-error "5:at file scope" } */ +/* { dg-warning "9:division by zero" "" { target *-*-* } 23 } */ +int (*d1)[1/0]; /* { dg-error "7:at file scope" } */ +/* { dg-warning "12:division by zero" "" { target *-*-* } 25 } */ +int (*d2())[1/0]; /* { dg-error "7:at file scope" } */ +/* { dg-warning "14:division by zero" "" { target *-*-* } 27 } */ +struct d3 { int x[1/0]; }; /* { dg-error "17:at file scope" } */ +/* { dg-warning "20:division by zero" "" { target *-*-* } 29 } */ +struct d4 { int (*x)[1/0]; }; /* { dg-error "19:at file scope" } */ +/* { dg-warning "23:division by zero" "" { target *-*-* } 31 } */ +typeof (int [1/0]) d5; /* { dg-error "20:at file scope" } */ diff --git a/gcc/testsuite/gcc.dg/asm-wide-1.c b/gcc/testsuite/gcc.dg/asm-wide-1.c index a42271fd4b1..c14b19d3479 100644 --- a/gcc/testsuite/gcc.dg/asm-wide-1.c +++ b/gcc/testsuite/gcc.dg/asm-wide-1.c @@ -3,27 +3,27 @@ /* { dg-do compile } */ /* { dg-options "" } */ -int foo asm (L"bar"); /* { dg-error "wide string literal in 'asm'" } */ +int foo asm (L"bar"); /* { dg-error "14:wide string literal in 'asm'" } */ -asm (L"foo"); /* { dg-error "wide string literal in 'asm'" } */ +asm (L"foo"); /* { dg-error "6:wide string literal in 'asm'" } */ void f (void) { int x = 1; - asm (L"foo"); /* { dg-error "wide string literal in 'asm'" } */ + asm (L"foo"); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : - L"=g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : [x] - L"=g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : [x] "=g" (x), - L"=g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : : - L"g" (x)); /* { dg-error "wide string literal in 'asm'" } */ + L"g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : : : - L"memory"); /* { dg-error "wide string literal in 'asm'" } */ + L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */ asm ("foo" : : : "memory", - L"memory"); /* { dg-error "wide string literal in 'asm'" } */ + L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */ } /* Extra errors from the substitution of "" for wide strings: */ diff --git a/gcc/testsuite/gcc.dg/builtins-30.c b/gcc/testsuite/gcc.dg/builtins-30.c index 65a78fefe1d..37e5dba2db6 100644 --- a/gcc/testsuite/gcc.dg/builtins-30.c +++ b/gcc/testsuite/gcc.dg/builtins-30.c @@ -1,29 +1,27 @@ /* { dg-do compile } */ -/* { dg-options "-Wall -Wshadow" } */ +/* { dg-options "-Wall -Wshadow -fshow-column" } */ extern double strtod (const char *, char **); #define UNUSED __attribute__ ((unused)) /* A built-in function may be overridden by an old-style definition specifying too few arguments... */ -double cos () /* { dg-warning "shadows a built-in" } */ +double cos () /* { dg-warning "shadows a built-in|number of arguments" } */ { - /* { dg-warning "number of arguments doesn't match built-in prototype" "built-in" { target *-*-* } 10 } */ return strtod ("nan", 0); } /* the right number, but the wrong type, arguments... */ -double sin (foo) /* { dg-warning "shadows a built-in" } */ - int foo UNUSED; -{ /* { dg-warning "argument 'foo' doesn't match built-in prototype" } */ +double sin (foo) /* { dg-warning "8:shadows a built-in" } */ + int foo UNUSED; /* { dg-warning "10:argument 'foo' doesn't match built-in prototype" } */ +{ return strtod ("nan", 0); } /* or too many arguments. */ -long double cosl (foo, bar) /* { dg-warning "shadows a built-in" } */ - const char *foo UNUSED; +long double cosl (foo, bar) /* { dg-warning "shadows a built-in|number of arguments" } */ + const char *foo UNUSED; /* { dg-warning "18:argument 'foo' doesn't match" } */ int bar UNUSED; -{ /* { dg-warning "number of arguments doesn't match built-in prototype" } */ - /* { dg-warning "argument 'foo' doesn't match built-in prototype" "foo" { target *-*-* } 26 } */ +{ return strtod ("nan", 0); } diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-5.c b/gcc/testsuite/gcc.dg/c90-const-expr-5.c index 0a5af8124cd..9f5cdef8399 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-5.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-5.c @@ -2,7 +2,7 @@ qualified void. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do compile } */ -/* { dg-options "-std=iso9899:1990 -pedantic-errors -fshow-column" } */ +/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */ typedef void V; int *p; @@ -15,14 +15,14 @@ f (void) { /* (V *)0 is a null pointer constant, so the assignment should be diagnosed. */ - q = (j ? p : (V *)0); /* { dg-error "3:assignment from incompatible pointer type" } */ - q = (j ? p : (void *)0); /* { dg-error "3:assignment from incompatible pointer type" } */ + q = (j ? p : (V *)0); /* { dg-error "5:assignment from incompatible pointer type" } */ + q = (j ? p : (void *)0); /* { dg-error "5:assignment from incompatible pointer type" } */ /* And this conversion should be valid. */ (void (*)(void))(V *)0; (void (*)(void))(void *)0; /* Pointers to qualified void are not valid null pointer constants. */ - fp = (const void *)0; /* { dg-error "3:ISO C forbids assignment between function pointer and 'void \\*'" } */ + fp = (const void *)0; /* { dg-error "6:ISO C forbids assignment between function pointer and 'void \\*'" } */ fp = (void *)0; fp = (V *)0; fp = 0; diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-8.c b/gcc/testsuite/gcc.dg/c90-const-expr-8.c index 966044c4eff..b00bb9718f8 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-8.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-8.c @@ -9,19 +9,19 @@ #include <limits.h> enum e { - E0 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 12 } */ - E1 = 0 * (INT_MIN / -1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 14 } */ - E2 = 0 * (INT_MAX * INT_MAX), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 16 } */ - E3 = 0 * (INT_MIN - 1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 18 } */ - E4 = 0 * (unsigned)(INT_MIN - 1), /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 20 } */ - E5 = 0 * -INT_MIN, /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 22 } */ - E6 = 0 * !-INT_MIN, /* { dg-warning "integer overflow in expression" } */ - /* { dg-error "not an integer constant" "constant" { target *-*-* } 24 } */ + E0 = 0 * (INT_MAX + 1), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 12 } */ + E1 = 0 * (INT_MIN / -1), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 14 } */ + E2 = 0 * (INT_MAX * INT_MAX), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 16 } */ + E3 = 0 * (INT_MIN - 1), /* { dg-warning "21:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 18 } */ + E4 = 0 * (unsigned)(INT_MIN - 1), /* { dg-warning "31:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 20 } */ + E5 = 0 * -INT_MIN, /* { dg-warning "12:integer overflow in expression" } */ + /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 22 } */ + E6 = 0 * !-INT_MIN, /* { dg-warning "13:integer overflow in expression" } */ + /* { dg-error "3:not an integer constant" "constant" { target *-*-* } 24 } */ E7 = INT_MIN % -1 /* Not an overflow. */ }; diff --git a/gcc/testsuite/gcc.dg/c99-tag-3.c b/gcc/testsuite/gcc.dg/c99-tag-3.c index 7406e7d64c7..a492037b07a 100644 --- a/gcc/testsuite/gcc.dg/c99-tag-3.c +++ b/gcc/testsuite/gcc.dg/c99-tag-3.c @@ -13,10 +13,10 @@ void f (void) { struct s0; } /* A declaration with a qualifier or storage class specifier declares the tag if no other declaration of it is visible. */ -const union u0; /* { dg-warning "useless type qualifier in empty declaration" } */ +const union u0; /* { dg-warning "13:useless type qualifier in empty declaration" } */ union u0 { long b; }; -extern struct s1; /* { dg-warning "useless storage class specifier in empty declaration" } */ +extern struct s1; /* { dg-warning "15:useless storage class specifier in empty declaration" } */ /* But if a declaration of the tag is visible, whether at the same scope or an outer scope, the declaration specifies the same type as @@ -25,13 +25,13 @@ extern struct s1; /* { dg-warning "useless storage class specifier in empty decl the members of an enumeration, it is a constraint violation. */ struct s2 { char x; }; -const struct s2; /* { dg-error "empty declaration with type qualifier does not redeclare tag" } */ +const struct s2; /* { dg-error "14:empty declaration with type qualifier does not redeclare tag" } */ union u1; -extern union u1; /* { dg-error "empty declaration with storage class specifier does not redeclare tag" } */ +extern union u1; /* { dg-error "14:empty declaration with storage class specifier does not redeclare tag" } */ union u2 { long b; }; -void g(void) { const union u2; } /* { dg-error "empty declaration with type qualifier does not redeclare tag" } */ +void g(void) { const union u2; } /* { dg-error "28:empty declaration with type qualifier does not redeclare tag" } */ /* And it does not redeclare the tag either if the outer tag is the wrong kind of tag. This also yields an error for the reference to @@ -39,21 +39,21 @@ void g(void) { const union u2; } /* { dg-error "empty declaration with type qual declaration. */ union u3 { float v; }; -void h(void) { const struct u3; } /* { dg-error "'u3' defined as wrong kind of tag" } */ -/* { dg-error "empty declaration with type qualifier does not redeclare tag" "wrong tag empty" { target *-*-* } 42 } */ +void h(void) { const struct u3; } /* { dg-error "29:'u3' defined as wrong kind of tag" } */ +/* { dg-error "29:empty declaration with type qualifier does not redeclare tag" "wrong tag empty" { target *-*-* } 42 } */ /* However, such useless specifiers are OK if the contents of the tag are being defined, or shadowed in an inner scope with the contents included in the shadowing. */ struct s3; -const struct s3 { int a; }; /* { dg-warning "useless type qualifier in empty declaration" } */ +const struct s3 { int a; }; /* { dg-warning "14:useless type qualifier in empty declaration" } */ union u4; -extern union u4 { int z; }; /* { dg-warning "useless storage class specifier in empty declaration" } */ +extern union u4 { int z; }; /* { dg-warning "14:useless storage class specifier in empty declaration" } */ enum e0 { E0 }; -void i(void) { const enum e0 { E1 }; } /* { dg-warning "useless type qualifier in empty declaration" } */ +void i(void) { const enum e0 { E1 }; } /* { dg-warning "32:useless type qualifier in empty declaration" } */ union u5 { int p; }; -void j(void) { extern struct u5 { int q; }; } /* { dg-warning "useless storage class specifier in empty declaration" } */ +void j(void) { extern struct u5 { int q; }; } /* { dg-warning "30:useless storage class specifier in empty declaration" } */ diff --git a/gcc/testsuite/gcc.dg/c99-vla-jump-1.c b/gcc/testsuite/gcc.dg/c99-vla-jump-1.c index 4e984d2b81b..3cfa384d1ca 100644 --- a/gcc/testsuite/gcc.dg/c99-vla-jump-1.c +++ b/gcc/testsuite/gcc.dg/c99-vla-jump-1.c @@ -15,11 +15,11 @@ /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ void fa0 (int n) { goto a; a:{ 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; } -void fa1 (int n) { goto a; { int b[n]; a:{ 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; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa2 (int n) { goto a; { int b[n]; { int c[n]; a: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; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa3 (int n) { goto a; { int b[n]; { int c[n]; 0;} a:{ 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; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa4 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ -void fa5 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ +void fa1 (int n) { goto a; { int b[n]; a:{ 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; } /* { dg-error "41:jump into scope of identifier with variably modified type" } */ +void fa2 (int n) { goto a; { int b[n]; { int c[n]; a: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; } /* { dg-error "53:jump into scope of identifier with variably modified type" } */ +void fa3 (int n) { goto a; { int b[n]; { int c[n]; 0;} a:{ 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; } /* { dg-error "57:jump into scope of identifier with variably modified type" } */ +void fa4 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "69:jump into scope of identifier with variably modified type" } */ +void fa5 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "73:jump into scope of identifier with variably modified type" } */ void fa6 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ void fa7 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } void fa8 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */ diff --git a/gcc/testsuite/gcc.dg/cast-function-1.c b/gcc/testsuite/gcc.dg/cast-function-1.c index 8ed7d5da41c..781d0e22191 100644 --- a/gcc/testsuite/gcc.dg/cast-function-1.c +++ b/gcc/testsuite/gcc.dg/cast-function-1.c @@ -22,14 +22,14 @@ void bar(void) int i; str_t s; - d = ((double (*) (int)) foo1) (i); /* { dg-warning "non-compatible|abort" } */ - i = ((int (*) (double)) foo1) (d); /* { dg-warning "non-compatible|abort" } */ - s = ((str_t (*) (int)) foo1) (i); /* { dg-warning "non-compatible|abort" } */ + d = ((double (*) (int)) foo1) (i); /* { dg-warning "33:non-compatible|abort" } */ + i = ((int (*) (double)) foo1) (d); /* { dg-warning "33:non-compatible|abort" } */ + s = ((str_t (*) (int)) foo1) (i); /* { dg-warning "32:non-compatible|abort" } */ ((void (*) (int)) foo1) (d); /* { dg-warning "non-compatible|abort" } */ i = ((int (*) (int)) foo1) (i); /* { dg-bogus "non-compatible|abort" } */ (void) foo1 (i); /* { dg-bogus "non-compatible|abort" } */ - d = ((double (*) (int)) foo2) (i); /* { dg-warning "non-compatible|abort" } */ + d = ((double (*) (int)) foo2) (i); /* { dg-warning "33:non-compatible|abort" } */ i = ((int (*) (double)) foo2) (d); /* { dg-bogus "non-compatible|abort" } */ s = ((str_t (*) (int)) foo2) (i); /* { dg-warning "non-compatible|abort" } */ ((void (*) (int)) foo2) (d); /* { dg-warning "non-compatible|abort" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/line3.c b/gcc/testsuite/gcc.dg/cpp/line3.c index dc5bf818da9..7a1061478d4 100644 --- a/gcc/testsuite/gcc.dg/cpp/line3.c +++ b/gcc/testsuite/gcc.dg/cpp/line3.c @@ -14,15 +14,15 @@ main(void) char *A; A = "text"; /* { dg-warning "discards qualifiers" "case zero" } */ - A = one("text" + A = one("text" /* { dg-warning "discards qualifiers" "case one" } */ "text") - ; /* { dg-warning "discards qualifiers" "case one" } */ - A = two("text" + ; + A = two("text" /* { dg-warning "discards qualifiers" "case two" } */ "text") - ; /* { dg-warning "discards qualifiers" "case two" } */ - A = four("text" + ; + A = four("text" /* { dg-warning "discards qualifiers" "case four" } */ "text") - ; /* { dg-warning "discards qualifiers" "case four" } */ + ; return 0; } diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c index 61f0ba84fe3..980ead187e7 100644 --- a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c +++ b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c @@ -11,8 +11,8 @@ float dremf (float, float); /* { dg-warning "prototype declaration" } */ float dremf (x, y) - float x; - float y; -{ /* { dg-warning "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-warning "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-warning "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c index 437e26f65ba..3934a64e19f 100644 --- a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c +++ b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c @@ -11,8 +11,8 @@ float dremf (float, float); /* { dg-error "prototype declaration" } */ float dremf (x, y) - float x; - float y; -{ /* { dg-error "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-error "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-error "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc/testsuite/gcc.dg/enum-compat-1.c index 18d1f7fe715..5fb150cee79 100644 --- a/gcc/testsuite/gcc.dg/enum-compat-1.c +++ b/gcc/testsuite/gcc.dg/enum-compat-1.c @@ -12,8 +12,8 @@ enum e2 {c, d}; void f(enum e1); /* { dg-error "prototype" "error at decl" } */ void f(x) - enum e2 x; -{ /* { dg-error "doesn't match prototype" "error at defn" } */ + enum e2 x; /* { dg-error "doesn't match prototype" } */ +{ return; } diff --git a/gcc/testsuite/gcc.dg/func-ptr-conv-1.c b/gcc/testsuite/gcc.dg/func-ptr-conv-1.c index 4e42e5fe117..c331fbc88fc 100644 --- a/gcc/testsuite/gcc.dg/func-ptr-conv-1.c +++ b/gcc/testsuite/gcc.dg/func-ptr-conv-1.c @@ -9,15 +9,15 @@ void f(void); -void *v1 = f; /* { dg-warning "pointer" "bad conversion" } */ -void *v2 = &f; /* { dg-warning "pointer" "bad conversion" } */ -void *v3 = (void *)f; /* { dg-warning "pointer" "bad conversion" } */ -void *v4 = (void *)&f; /* { dg-warning "pointer" "bad conversion" } */ +void *v1 = f; /* { dg-warning "12:pointer" "bad conversion" } */ +void *v2 = &f; /* { dg-warning "12:pointer" "bad conversion" } */ +void *v3 = (void *)f; /* { dg-warning "12:pointer" "bad conversion" } */ +void *v4 = (void *)&f; /* { dg-warning "12:pointer" "bad conversion" } */ void *v5; -char *c1 = f; /* { dg-warning "pointer" "bad conversion" } */ -char *c2 = &f; /* { dg-warning "pointer" "bad conversion" } */ -char *c3 = (char *)f; /* { dg-warning "pointer" "bad conversion" } */ -char *c4 = (char *)&f; /* { dg-warning "pointer" "bad conversion" } */ +char *c1 = f; /* { dg-warning "12:pointer" "bad conversion" } */ +char *c2 = &f; /* { dg-warning "12:pointer" "bad conversion" } */ +char *c3 = (char *)f; /* { dg-warning "12:pointer" "bad conversion" } */ +char *c4 = (char *)&f; /* { dg-warning "12:pointer" "bad conversion" } */ char *c5; void (*fp)(void); int a; @@ -25,20 +25,20 @@ int a; void g(void) { - v5 = f; /* { dg-warning "pointer" "bad conversion" } */ - v5 = &f; /* { dg-warning "pointer" "bad conversion" } */ - v5 = (void *)f; /* { dg-warning "pointer" "bad conversion" } */ - v5 = (void *)&f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = &f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = (char *)f; /* { dg-warning "pointer" "bad conversion" } */ - c5 = (char *)&f; /* { dg-warning "pointer" "bad conversion" } */ - fp = v5; /* { dg-warning "pointer" "bad conversion" } */ - fp = c5; /* { dg-warning "pointer" "bad conversion" } */ - fp = (void (*)(void))v5; /* { dg-warning "pointer" "bad conversion" } */ - fp = (void (*)(void))c5; /* { dg-warning "pointer" "bad conversion" } */ - (a ? f : v3); /* { dg-warning "pointer" "bad conversion" } */ - (a ? v2 : fp); /* { dg-warning "pointer" "bad conversion" } */ + v5 = f; /* { dg-warning "6:pointer" "bad conversion" } */ + v5 = &f; /* { dg-warning "6:pointer" "bad conversion" } */ + v5 = (void *)f; /* { dg-warning "8:pointer" "bad conversion" } */ + v5 = (void *)&f; /* { dg-warning "8:pointer" "bad conversion" } */ + c5 = f; /* { dg-warning "6:pointer" "bad conversion" } */ + c5 = &f; /* { dg-warning "6:pointer" "bad conversion" } */ + c5 = (char *)f; /* { dg-warning "8:pointer" "bad conversion" } */ + c5 = (char *)&f; /* { dg-warning "8:pointer" "bad conversion" } */ + fp = v5; /* { dg-warning "6:pointer" "bad conversion" } */ + fp = c5; /* { dg-warning "6:pointer" "bad conversion" } */ + fp = (void (*)(void))v5; /* { dg-warning "8:pointer" "bad conversion" } */ + fp = (void (*)(void))c5; /* { dg-warning "8:pointer" "bad conversion" } */ + (a ? f : v3); /* { dg-warning "6:pointer" "bad conversion" } */ + (a ? v2 : fp); /* { dg-warning "6:pointer" "bad conversion" } */ /* The following are OK. */ fp = 0; fp = (void *)0; diff --git a/gcc/testsuite/gcc.dg/gomp/for-1.c b/gcc/testsuite/gcc.dg/gomp/for-1.c index 840f9478499..384293e8275 100644 --- a/gcc/testsuite/gcc.dg/gomp/for-1.c +++ b/gcc/testsuite/gcc.dg/gomp/for-1.c @@ -44,6 +44,6 @@ void foo (int j, int k) baz (i); #pragma omp for - for (i = 0; i < 10; i-=3, j+=2) /* { dg-error "23:invalid increment expression" } */ + for (i = 0; i < 10; i-=3, j+=2) /* { dg-error "27:invalid increment expression" } */ baz (i); } diff --git a/gcc/testsuite/gcc.dg/gomp/pr27415.c b/gcc/testsuite/gcc.dg/gomp/pr27415.c index 418eaf678e9..010a6c3e4dd 100644 --- a/gcc/testsuite/gcc.dg/gomp/pr27415.c +++ b/gcc/testsuite/gcc.dg/gomp/pr27415.c @@ -15,8 +15,8 @@ void test2 (void) { int i = 0; -#pragma omp parallel for firstprivate (i) - for (i = 0; i < 10; i++) /* { dg-error "should not be firstprivate" } */ +#pragma omp parallel for firstprivate (i) /* { dg-error "should not be firstprivate" } */ + for (i = 0; i < 10; i++) ; } @@ -34,8 +34,8 @@ void test4 (void) { int i = 0; -#pragma omp parallel for reduction (*:i) - for (i = 0; i < 10; i++) /* { dg-error "should not be reduction" } */ +#pragma omp parallel for reduction (*:i) /* { dg-error "should not be reduction" } */ + for (i = 0; i < 10; i++) ; } diff --git a/gcc/testsuite/gcc.dg/label-decl-2.c b/gcc/testsuite/gcc.dg/label-decl-2.c index 97c453b78b7..6706a706bfe 100644 --- a/gcc/testsuite/gcc.dg/label-decl-2.c +++ b/gcc/testsuite/gcc.dg/label-decl-2.c @@ -8,9 +8,8 @@ typedef int b; void f (void) { - __label__ a, b, c, d; + __label__ a, b, c, d; /* { dg-warning "ISO C forbids label declarations" "label decls" { target *-*-* } 11 } */ __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */ - /* { dg-warning "ISO C forbids label declarations" "label decls" { target *-*-* } 11 } */ goto c; /* { dg-error "label 'c' used but not defined" } */ a: (void)0; b: (void)0; diff --git a/gcc/testsuite/gcc.dg/nofixed-point-2.c b/gcc/testsuite/gcc.dg/nofixed-point-2.c index 97bbf70225c..5820ded922e 100644 --- a/gcc/testsuite/gcc.dg/nofixed-point-2.c +++ b/gcc/testsuite/gcc.dg/nofixed-point-2.c @@ -9,7 +9,7 @@ f1 (void) } __typeof (0r) /* { dg-error "not supported" "reject fixed-point" } */ -b2 (void) +b2 (void) /* { dg-warning "defaults to" } */ { return 0r; /* { dg-error "not supported" "reject fixed-point" } */ } @@ -26,5 +26,4 @@ f4 (void) /* { dg-error "not supported" "reject fixed-point" } */ return 0k; /* { dg-error "not supported" "reject fixed-point" } */ } -/* { dg-warning "defaults to" "" { target *-*-* } 13 } */ /* { dg-error "is used without" "" { target *-*-* } 24 } */ diff --git a/gcc/testsuite/gcc.dg/old-style-prom-2.c b/gcc/testsuite/gcc.dg/old-style-prom-2.c index 0460facef61..e7e690e1417 100644 --- a/gcc/testsuite/gcc.dg/old-style-prom-2.c +++ b/gcc/testsuite/gcc.dg/old-style-prom-2.c @@ -7,8 +7,8 @@ float f (float, float); /* { dg-warning "prototype declaration" } */ float f (x, y) - float x; - float y; -{ /* { dg-warning "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-warning "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-warning "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/old-style-prom-3.c b/gcc/testsuite/gcc.dg/old-style-prom-3.c index 931a4a7264b..720367f2e33 100644 --- a/gcc/testsuite/gcc.dg/old-style-prom-3.c +++ b/gcc/testsuite/gcc.dg/old-style-prom-3.c @@ -7,8 +7,8 @@ float f (float, float); /* { dg-error "prototype declaration" } */ float f (x, y) - float x; - float y; -{ /* { dg-error "promoted argument '.' doesn't match prototype" } */ + float x; /* { dg-error "promoted argument 'x' doesn't match prototype" } */ + float y; /* { dg-error "promoted argument 'y' doesn't match prototype" } */ +{ return x + y; } diff --git a/gcc/testsuite/gcc.dg/overflow-warn-1.c b/gcc/testsuite/gcc.dg/overflow-warn-1.c index 0cf08a3e77f..78909df368b 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-1.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-1.c @@ -12,23 +12,23 @@ enum e { /* Overflow in an unevaluated part of an expression is OK (example in the standard). */ E2 = 2 || 1 / 0, - E3 = 1 / 0, /* { dg-warning "division by zero" } */ - /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ + E3 = 1 / 0, /* { dg-warning "10:division by zero" } */ + /* { dg-error "3:enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ /* But as in DR#031, the 1/0 in an evaluated subexpression means the whole expression violates the constraints. */ - E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */ + E4 = 0 * (1 / 0), /* { dg-warning "15:division by zero" } */ /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } 19 } */ - E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */ + E5 = INT_MAX + 1, /* { dg-warning "16:integer overflow in expression" } */ /* Again, overflow in evaluated subexpression. */ - E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */ + E6 = 0 * (INT_MAX + 1), /* { dg-warning "21:integer overflow in expression" } */ /* A cast does not constitute overflow in conversion. */ E7 = (char) INT_MAX }; struct s { int a; - int : 0 * (1 / 0); /* { dg-warning "division by zero" } */ - /* { dg-error "not an integer constant" "integer constant" { target *-*-* } 30 } */ + int : 0 * (1 / 0); /* { dg-warning "16:division by zero" } */ + /* { dg-error "not an integer constant" "22:integer constant" { target *-*-* } 30 } */ int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ }; @@ -37,11 +37,11 @@ f (void) { /* This expression is not required to be a constant expression, so it should just involve undefined behavior at runtime. */ - int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ + int c = INT_MAX + 1; /* { dg-warning "19:integer overflow in expression" } */ } /* But this expression does need to be constant. */ -static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ +static int sc = INT_MAX + 1; /* { dg-warning "25:integer overflow in expression" } */ /* The first two of these involve overflow, so are not null pointer constants. The third has the overflow in an unevaluated diff --git a/gcc/testsuite/gcc.dg/pr15698-1.c b/gcc/testsuite/gcc.dg/pr15698-1.c index 6bb001aea7f..5a75a10733f 100644 --- a/gcc/testsuite/gcc.dg/pr15698-1.c +++ b/gcc/testsuite/gcc.dg/pr15698-1.c @@ -17,7 +17,7 @@ int foobar () } char *rindex(a, b) - register char *a, b; -{ /* { dg-warning "argument 'a' doesn't match built-in prototype" } */ + register char *a, b; /* { dg-warning "argument 'a' doesn't match built-in prototype" } */ +{ return 0; } diff --git a/gcc/testsuite/gcc.dg/pr20368-1.c b/gcc/testsuite/gcc.dg/pr20368-1.c index ac76c16f783..4140397c142 100644 --- a/gcc/testsuite/gcc.dg/pr20368-1.c +++ b/gcc/testsuite/gcc.dg/pr20368-1.c @@ -6,7 +6,7 @@ extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */ int -f (x) - float x; /* { dg-warning "function declaration isn't a prototype" } */ +f (x) /* { dg-warning "function declaration isn't a prototype" } */ + float x; { } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/col-1.c b/gcc/testsuite/gcc.dg/tree-ssa/col-1.c new file mode 100644 index 00000000000..5838134ad21 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/col-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-gimple-details-lineno" } */ + +void foo (int, int); + +int +m(int x) +{ + int c, a; + a = (c = 5) + 16 + x * 2 ; + foo (c, a); +} + +/* { dg-final { scan-tree-dump-times "10:9.*c = 5" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "10:14.*c . 16" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "10:4.*a =" 1 "gimple" } } */ +/* { dg-final { cleanup-tree-dump "gimple" } } */ diff --git a/gcc/testsuite/gcc.dg/vla-8.c b/gcc/testsuite/gcc.dg/vla-8.c index e4c6ae4157f..1d31876b9b4 100644 --- a/gcc/testsuite/gcc.dg/vla-8.c +++ b/gcc/testsuite/gcc.dg/vla-8.c @@ -23,8 +23,8 @@ void foo1(int n) { } void foo2(int n) { - goto A; /* { dg-error "jump into scope of identifier with variably modified type" } */ + goto A; int (*(*bar2)(void))[n]; - A: + A: /* { dg-error "jump into scope of identifier with variably modified type" } */ ; } |