PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-6-global.c
blob7ac4e1ed949caecd6d2aaa7bf6d33d459ff74f8c
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 * __restrict__ b, int k){
12 int i,j;
13 int sum,x;
15 for (i = 0; i < N; i++) {
16 sum = b[i];
17 for (j = 0; j < N; j++) {
18 sum += j;
20 a[i] = sum;
23 return a[k];
26 int main (void)
28 int i,j;
29 int sum;
30 int b[N];
31 int a[N];
33 check_vect ();
35 for (i=0; i<N; i++)
36 b[i] = i + 2;
38 for (i=0; i<N; i++)
39 a[i] = foo (b,i);
41 /* check results: */
42 for (i=0; i<N; i++)
44 sum = b[i];
45 for (j = 0; j < N; j++){
46 sum += j;
48 if (a[i] != sum)
49 abort();
52 return 0;
55 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */