1 /* { dg-require-effective-target vect_int_mult } */ 2 3 #include <stdarg.h> 4 #include "tree-vect.h" 5 6 #define K 4 7 8 int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); 9 int out[K]; 10 int check_result[K] = {0,16,256,4096}; 11 12 __attribute__ ((noinline)) void foo()13foo () 14 { 15 int sum; 16 int i, j, k; 17 18 for (k = 0; k < K; k++) 19 { 20 sum = 1; 21 for (j = 0; j < K; j++) 22 for (i = 0; i < K; i++) 23 sum *= in[i+k][j]; 24 out[k] = sum; 25 } 26 } 27 main()28int main () 29 { 30 int i, j, k; 31 32 check_vect (); 33 34 for (i = 0; i < 2*K; i++) 35 for (j = 0; j < K; j++) 36 in[i][j] = (i+2)/3; 37 38 foo(); 39 40 for (k = 0; k < K; k++) 41 if (out[k] != check_result[k]) 42 abort (); 43 44 return 0; 45 } 46 47 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */ 48 49