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/] [vect/] [no-scevccp-outer-4.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 40
7
 
8
int a[N];
9
 
10
/* induction variable k advances through inner and outer loops.  */
11
 
12
__attribute__ ((noinline)) int
13
foo (int n){
14
  int i,j,k=0;
15
  int sum;
16
 
17
  if (n<=0)
18
    return 0;
19
 
20
  for (i = 0; i < N; i++) {
21
    sum = 0;
22
    for (j = 0; j < n; j+=2) {
23
      sum += k++;
24
    }
25
    a[i] = sum + j;
26
  }
27
}
28
 
29
int main (void)
30
{
31
  int i,j,k=0;
32
  int sum;
33
 
34
  check_vect ();
35
 
36
  for (i=0; i<N; i++)
37
    a[i] = i;
38
 
39
  foo (N);
40
 
41
    /* check results:  */
42
  for (i=0; i<N; i++)
43
    {
44
      sum = 0;
45
      for (j = 0; j < N; j+=2)
46
        sum += k++;
47
      if (a[i] != sum + j)
48
        abort();
49
    }
50
 
51
  return 0;
52
}
53
 
54
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
55
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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