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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [loop-15.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* A test for # of iterations analysis (signed counter cannot wrap) and final
2
   value replacement.  */
3
 
4
/* { dg-options "-O2 -fdump-tree-optimized" } */
5
 
6
int foo(void);
7
 
8
int bla(void)
9
{
10
  int i, n = foo (), j;
11
 
12
  j = 0;
13
  /* The loop should be removed completely.  */
14
  for (i = 1; i <= n; i++)
15
    j += n;
16
 
17
  /* Should be replaced with return n * n;  */
18
  return j;
19
}
20
 
21
/* Since the loop is removed, there should be no addition.  */
22
/* { dg-final { scan-tree-dump-times "\\+" 0 "optimized" } } */
23
/* { dg-final { scan-tree-dump-times "n_. \\* n_." 1 "optimized" } } */
24
 
25
/* The if from the loop header copying remains in the code.  */
26
/* { dg-final { scan-tree-dump-times "if " 1 "optimized" } } */
27
/* { 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.