aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asan/pr82517.c
blob: c7743ecb8b1978b23d537bb0e268cbcc8fbe93d4 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* PR sanitizer/82517.  */

static int *pp;

void
baz ()
{
  return;
}

void
bar (int *p)
{
  *p = 1;
}

void
foo (int a)
{
  if (a == 2)
    {
    lab:
      baz ();
      return;
    }
  if (a > 1)
    {
      int x __attribute__ ((aligned (256)));
      pp = &x;
      bar (&x);
      if (!x)
	goto lab;
    }
}

int
main (int argc, char **argv)
{
  foo (4);
  foo (3);

  return 0;
}