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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [no-scevccp-outer-3.c] - Blame information for rev 338

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