summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/loop-11.c
blob: d6c656f31f077ec2b2758d85fcf66714f9e3cd29 (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
27
28
/* A test for final value replacement and higher-order ivs,
   see PR 22442.  */

/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-optimized" } */

void bar (unsigned);

void foo (void)
{
  unsigned i, a;

  for (i = 0; i < 5; i++)
    a = i * i;

  bar (a);
}

/* Final value of a gets replaced.  */

/* { dg-final { scan-tree-dump-times "\\(16\\)" 1 "optimized" } } */

/* And the empty loop is removed.  */

/* { dg-final { scan-tree-dump-times "if " 0 "optimized" } } */

/* { dg-final { cleanup-tree-dump "optimized" } } */