aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/modref-4.c
blob: a277c70677ed0a9dd0febe756d6ff65cdb5ce3e5 (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
/* { dg-options "-O2 -fdump-tree-modref1"  } */
/* { dg-do compile } */
__attribute__((noinline))
void a(char *ptr, char *ptr2)
{
  (*ptr)++;
  (*ptr2)++;
}

__attribute__((noinline))
void b(char *ptr)
{
  a(ptr+1,&ptr[3]);
}

int main()
{
  char c[5]={0,1,2,0,0};
  b(c);
  return c[0]+c[4];
}
/* Check that both param offsets are determined correctly and the computation
   is optimized out.  */
/* { dg-final { scan-tree-dump "param offset:1" "modref1"  } } */
/* { dg-final { scan-tree-dump "param offset:3" "modref1"  } } */
/* { dg-final { scan-tree-dump "return 0" "modref1"  } } */