aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asan/nested-1.c
blob: 87e842098077cfdb9cc5120c16307d0b8f6eb65f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-fsanitize=address" } */

int f(int i) {
  auto int h() {
    int r;
    int *p;

    {
      int x[3];

      auto int g() {
	return x[i];
      }

      p = &r;
      *p = g();
    }

    return *p;
  }

  return h();
}