Adjust scan string for PIE
[official-gcc.git] / gcc / testsuite / gcc.dg / 20040223-1.c
blob71ddf099e7e60273f28355b4b002474e14ea6ee3
1 /* GCC was not warning about taking the address of parameters or
2 fields of struct parameters when returning them. */
3 /* PR c/14156 */
5 /* { dg-do compile } */
8 int * f( int a)
10 return &a;/* { dg-warning "address" "" } */
13 int * g()
15 int b = 0;
16 return &b;/* { dg-warning "address" "" } */
19 struct ll
21 int i;
24 int *h(struct ll c)
26 return &c.i;/* { dg-warning "address" "" } */
30 struct ll d;
32 int *i()
34 return &d.i;/* { dg-bogus "address" "" } */
38 int *j(struct ll *c)
40 return &c->i; /* { dg-bogus "address" "" } */