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

/* Make sure CCP propagates through indirect calls.  */

int foo (void)
{
  int i = -5;
  int (*fn)(int) = __builtin_abs;
  int j = fn(i);
  return j + 5;
}

/* { dg-final { scan-tree-dump "return 10;" "ccp1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */