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 a[N]; 9 10 __attribute__ ((noinline)) int foo(int n)11foo (int n){ 12 int i,j; 13 int sum; 14 15 for (i = 0; i < N; i++) { 16 sum = 0; 17 for (j = 0; j < n; j++) { 18 sum += j; 19 } 20 a[i] = sum; 21 } 22 } 23 main(void)24int main (void) 25 { 26 int i,j; 27 int sum; 28 29 check_vect (); 30 31 for (i=0; i<N; i++) 32 a[i] = i; 33 34 foo (N); 35 36 /* check results: */ 37 for (i=0; i<N; i++) 38 { 39 sum = 0; 40 for (j = 0; j < N; j++) 41 sum += j; 42 if (a[i] != sum) 43 abort(); 44 } 45 46 return 0; 47 } 48 49 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */ 50