view gcc/testsuite/gcc.dg/asan/pr82517.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* 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;
}