1 /* { dg-do compile } */ 2 /* { dg-require-effective-target vect_int } */ 3 4 int f(int * x,int b1,int b2,int b3)5f (int *x, int b1, int b2, int b3) 6 { 7 int foo = 0; 8 for (int i1 = 0; i1 < b1; ++i1) 9 for (int i2 = 0; i2 < b2; ++i2) 10 for (int i3 = 0; i3 < b3; ++i3) 11 foo += x[i1 * b2 * b3 + i2 * b3 + (i3 - 1)]; 12 return foo; 13 } 14 15 /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" } } */ 16