OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [loop-5.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* A test for induction variable merging.  */
2
 
3
/* { dg-do compile } */
4
/* { dg-options "-O1 -fdump-tree-optimized" } */
5
 
6
void foo(long);
7
 
8
void xxx(void)
9
{
10
  long iter, jter;
11
 
12
  for (iter = 0, jter = 2; iter < 100; iter++, jter++)
13
    {
14
      foo (iter);
15
      foo (jter);
16
    }
17
}
18
 
19
/* Only iter variable should remain.  */
20
 
21
/* { dg-final { scan-tree-dump-times "int iter" 1 "optimized" } } */
22
 
23
/* And jter shouldn't be an induction variable anymore (no PHI node).  */
24
/* { dg-final { scan-tree-dump-times "jter_\[0-9\]* = PHI" 0 "optimized" } } */
25
 
26
/* And the use of jter should be replaced by iter + 2 */
27
 
28
/* { dg-final { scan-tree-dump-times " \\+ 2" 1 "optimized" } } */
29
 
30
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.