aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/sccp-16.c
blob: c35426fc8c4780b388b55b9a20894b3274590474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cunrolli -fdump-tree-sccp-details" } */

int foo ()
{
  const char *s = "Hello World!";
  int len = 0;
  while (s[len])
    ++len;
  return len;
}

/* For cunrolli the growth is too large, but it should add a canonical IV
   and SCCP peform final value replacement.  */
/* { dg-final { scan-tree-dump "ivtmp\[^\r\n\]*PHI\[^\r\n\]*13" "cunrolli" } } */
/* { dg-final { scan-tree-dump "with expr: 12" "sccp" } } */