aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-local-addr.c
blob: d496d205e89b54bd751bf91864f247923002d1d8 (plain)
1
2
3
4
5
6
7
8
9
/* { dg-do assemble  } */
/* { dg-options "-Werror=return-local-addr" } */
/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */

int* bad()
{
  int x = 0;
  return &x;		/* { dg-error "address of local variable" } */
}