summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
blob: 767e935e7917cc32772502a3ee50f2c68c2e6f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-O1 -fivcanon -funroll-loops -fdump-tree-ivcanon-details" } */

void xxx(void)
{
  int x = 45;

  while (x >>= 1)
    foo ();
}

/* We should be able to find out that the loop iterates four times and unroll it completely.  */

/* { dg-final { scan-tree-dump-times "Added canonical iv to loop 1, 4 iterations" 1 "ivcanon"} } */
/* { dg-final { scan-assembler-times "foo" 5} } */


OpenPOWER on IntegriCloud