OSDN Git Service

* tree-vectorizer.h (vect_is_simple_reduction): Takes a loop_vec_info
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-noreassoc-outer-4.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 40
7
8 int
9 foo (){
10   int i,j;
11   int sum,s=0;
12
13   for (i = 0; i < 200*N; i++) {
14     sum = 0;
15     for (j = 0; j < N; j++) {
16       sum += (i + j);
17       i++;
18     }
19     s += sum;
20   }
21   return s;
22 }
23
24 int bar (int i, int j)
25 {
26 return (i + j);
27 }
28
29 int main (void)
30 {
31   int i,j,k=0;
32   int sum,s=0;
33   int res; 
34
35   check_vect ();
36
37   res = foo ();
38
39     /* check results:  */
40   for (i=0; i<200*N; i++)
41     {
42       sum = 0;
43       for (j = 0; j < N; j++){
44         sum += bar (i, j);
45         i++;
46       }
47       s += sum;
48     }
49   if (res != s)
50     abort ();
51
52   return 0;
53 }
54
55 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
56 /* { dg-final { cleanup-tree-dump "vect" } } */