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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [20030721-1.c] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-O2" } */
2
/* PR optimization/11536 */
3
/* Origin: samal@kam.mff.cuni.cz <samal@kam.mff.cuni.cz> */
4
/* Testcase by Andrew Pinski <pinskia@physics.uc.edu> */
5
 
6
/* Verify that the loop optimizer doesn't use moving targets
7
   to calculate the number of iterations of a loop.  */
8
 
9
extern void abort(void);
10
 
11
void foo(int) __attribute__((__noinline__));
12
 
13
void foo(int i)
14
{
15
  abort();
16
}
17
 
18
int main()
19
{
20
  int i;
21
  int first= 0;
22
  int last= 0;
23
 
24
  while (last<3) {
25
    last = first;
26
 
27
    while (first<=last) {
28
      first++;
29
 
30
      for (i=0;i<3;i++)
31
        last++;
32
 
33
      if (last>10)
34
        return 0;
35
    }
36
 
37
    foo(first);
38
  }
39
 
40
  return 0;
41
}

powered by: WebSVN 2.1.0

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