OSDN Git Service

PR tree-optimization/40542
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-12.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 64
7
8 int a[N];
9 short b[N];
10
11 __attribute__ ((noinline)) int
12 foo (){
13   int i,j;
14   int sum;
15
16   for (i = 0; i < N; i++) {
17     sum = 0;
18     for (j = 0; j < N; j++) {
19       sum += j;
20     }
21     a[i] = sum;
22     b[i] = (short)sum;
23   }
24 }
25
26 int main (void)
27 {
28   int i,j;
29   int sum;
30
31   check_vect ();
32
33   foo ();
34
35     /* check results:  */
36   for (i=0; i<N; i++)
37     {
38       sum = 0;
39       for (j = 0; j < N; j++)
40         sum += j;
41       if (a[i] != sum  || b[i] != (short)sum)
42         abort();
43     }
44
45   return 0;
46 }
47
48 /* Until we support multiple types in the inner loop  */
49 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
50 /* { dg-final { cleanup-tree-dump "vect" } } */