1 /* Test warnings for shadowing in function prototype scope: generally
2    useless but of use if the parameter is used within the scope.  Bug
3    529.  */
4 /* Origin: Joseph Myers <joseph@codesourcery.com> */
5 /* { dg-do compile } */
6 /* { dg-options "-std=gnu89 -Wshadow" } */
7 
8 int v; /* { dg-warning "shadowed declaration" } */
9 int f1(int v);
10 int f2(int v, int x[v]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */
11 int f3(int v, int y[sizeof(v)]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */
f4(int v)12 int f4(int v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
f5(int v,int x[v])13 int f5(int v, int x[v]) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
f6(int x)14 int f6(int x) { return 0; }
f7(v)15 int f7(v) int v; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
f8(v,w)16 int f8(v, w) int v; int w[v]; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
f9(x)17 int f9(x) int x; { return 0; }
f10(v)18 int f10(v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
19 int f11(int a, int b(int a));
20 int f12(int a, int b(int a, int x[a])); /* { dg-warning "declaration of 'a' shadows a parameter" } */
21 /* { dg-warning "shadowed declaration" "outer parm" { target *-*-* } 20 } */
22