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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [no-scevccp-outer-21.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 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;
13
  unsigned short j;
14
  int sum = 0;
15
  unsigned short sum_j;
16
 
17
  for (i = 0; i < N; i++) {
18
    sum += i;
19
 
20
    sum_j = i;
21
    for (j = 0; j < N; j++) {
22
      sum_j += j;
23
    }
24
    a[i] = sum_j + 5;
25
  }
26
  return sum;
27
}
28
 
29
int main (void)
30
{
31
  int i;
32
  unsigned short j, sum_j;
33
  int sum = 0;
34
  int res;
35
 
36
  check_vect ();
37
 
38
  for (i=0; i<N; i++)
39
    a[i] = i;
40
 
41
  res = foo ();
42
 
43
  /* check results:  */
44
  for (i=0; i<N; i++)
45
    {
46
      sum += i;
47
 
48
      sum_j = i;
49
      for (j = 0; j < N; j++){
50
        sum_j += j;
51
      }
52
      if (a[i] != sum_j + 5)
53
        abort();
54
    }
55
  if (res != sum)
56
    abort ();
57
 
58
  return 0;
59
}
60
 
61
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! { vect_pack_trunc } } } } } */
62
/* { 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.