1 /* { dg-require-effective-target vect_int } */
9 void foo (unsigned short *__restrict__ pInput, unsigned short *__restrict__ pOutput)
11 unsigned short i, a, b, c;
13 for (i = 0; i < N / 3; i++)
19 *pOutput++ = a + b + c + 3;
20 *pOutput++ = a + b + c + 12;
21 *pOutput++ = a + b + c + 1;
25 int main (int argc, const char* argv[])
27 unsigned short input[N], output[N], i;
28 unsigned short check_results[N];
32 for (i = 0; i < N; i++)
40 for (i = 0; i < N / 3; i++)
42 check_results[3*i] = 9 * i + 6;
43 check_results[3*i+1] = 9 * i + 15;
44 check_results[3*i+2] = 9 * i + 4;
49 for (i = 0; i < N - (N % 3); i++)
50 if (output[i] != check_results[i])
56 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
57 /* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm } } } */
58 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
59 /* { dg-final { cleanup-tree-dump "vect" } } */