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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [run-id-6.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model -fno-tree-scev-cprop -fgraphite-identity" } */
2
/* { dg-require-effective-target vect_int } */
3
 
4
/* gcc.dg/vect/no-scevccp-outer-4.c was miscompiled by Graphite.
5
   Adding it here to always test it with Graphite.  */
6
 
7
#include <stdarg.h>
8
 
9
extern void abort ();
10
#define N 40
11
 
12
int a[N];
13
 
14
/* induction variable k advances through inner and outer loops.  */
15
 
16
__attribute__ ((noinline)) int
17
foo (int n){
18
  int i,j,k=0;
19
  int sum;
20
 
21
  if (n<=0)
22
    return 0;
23
 
24
  for (i = 0; i < N; i++) {
25
    sum = 0;
26
    for (j = 0; j < n; j+=2) {
27
      sum += k++;
28
    }
29
    a[i] = sum + j;
30
  }
31
}
32
 
33
int main (void)
34
{
35
  int i,j,k=0;
36
  int sum;
37
 
38
  for (i=0; i<N; i++)
39
    a[i] = i;
40
 
41
  foo (N);
42
 
43
    /* check results:  */
44
  for (i=0; i<N; i++)
45
    {
46
      sum = 0;
47
      for (j = 0; j < N; j+=2)
48
        sum += k++;
49
      if (a[i] != sum + j)
50
        abort();
51
    }
52
 
53
  return 0;
54
}
55
 

powered by: WebSVN 2.1.0

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