summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c
blob: f29c4942ace0460a2dc1ddcce4cd3b191448f7f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-ccp1 -fdump-tree-forwprop1" } */

int a[256];
int foo(int i)
{
  int *p = &a[0];
  return *(p + i);
}

/* { dg-final { scan-tree-dump "&a\\\[\[iD\]\\\." "ccp1" } } */
/* { dg-final { scan-tree-dump "= a\\\[\[iD\]\\\." "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */