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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr39794.c] - Blame information for rev 717

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR rtl-optimization/39794 */
2
/* { dg-do run } */
3
/* { dg-options "-O2 -funroll-loops" } */
4
 
5
extern void abort ();
6
 
7
void
8
foo (int *a, int n)
9
{
10
  int i;
11
  for (i = 0; i < n; i++)
12
    {
13
      a[i] *= 2;
14
      a[i + 1] = a[i - 1] + a[i - 2];
15
    }
16
}
17
 
18
int a[16];
19
int ref[16] = { 0, 1, 4, 2, 10, 12, 24, 44,
20
                72, 136, 232, 416, 736, 1296, 2304, 2032 };
21
 
22
int
23
main ()
24
{
25
  int i;
26
  for (i = 0; i < 16; i++)
27
    a[i] = i;
28
  foo (a + 2, 16 - 3);
29
  for (i = 0; i < 16; i++)
30
    if (ref[i] != a[i])
31
      abort ();
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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