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-22.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
__attribute__ ((noinline)) int
11
foo (int n){
12
  int i,j;
13
  int sum;
14
 
15
  if (n<=0)
16
    return 0;
17
 
18
  /* inner-loop index j used after the inner-loop */
19
  for (i = 0; i < N; i++) {
20
    sum = 0;
21
    for (j = 0; j < n; j+=2) {
22
      sum += j;
23
    }
24
    a[i] = sum + j;
25
  }
26
}
27
 
28
int main (void)
29
{
30
  int i,j;
31
  int sum;
32
 
33
  check_vect ();
34
 
35
  for (i=0; i<N; i++)
36
    a[i] = i;
37
 
38
  foo (N);
39
 
40
    /* check results:  */
41
  for (i=0; i<N; i++)
42
    {
43
      sum = 0;
44
      for (j = 0; j < N; j+=2)
45
        sum += j;
46
      if (a[i] != sum + j)
47
        abort();
48
    }
49
 
50
  return 0;
51
}
52
 
53
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
54
/* { 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.