aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/modref-5.c
blob: 0bee79d769d5a15e5ed14d4ed05bbabd73efce7e (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
/* { dg-options "-O2 -fdump-tree-modref1"  } */
/* { dg-do run } */
__attribute__ ((noinline))
void
copy (int *a, int *b)
{
  *a=*b;
}
int p, *ptr = &p;
__attribute__ ((noinline))
void
barrier ()
{
  asm ("":"=r"(ptr):"0"(ptr));
}
int
main()
{
  int a = 1, b = 2;
  copy (&a,&b);
  barrier ();
  *ptr = 1;
  if (!__builtin_constant_p (b == 2))
    __builtin_abort ();
  return 0;
}
/* { dg-final { scan-tree-dump "parm 1 flags: no_direct_clobber no_direct_escape" "modref1"  } } */