2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-11.c
blobf5aeac981870d0e58679d5574dd12e2c4b40d23a
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 40
8 int a[N];
10 __attribute__ ((noinline)) int
11 foo (int n){
12 int i,j;
13 int sum;
15 for (i = 0; i < n; i++) {
16 sum = 0;
17 for (j = 0; j < N; j++) {
18 sum += j;
20 a[i] = sum;
24 int main (void)
26 int i,j;
27 int sum;
29 check_vect ();
31 for (i=0; i<N; i++)
32 a[i] = i;
34 foo (N);
36 /* check results: */
37 for (i=0; i<N; i++)
39 sum = 0;
40 for (j = 0; j < N; j++)
41 sum += j;
42 if (a[i] != sum)
43 abort();
46 return 0;
49 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */