openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / bb-slp-42.c
blob69fd0968491544f98d1406ff8a166b723714dd23
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_perm } */
4 #include "tree-vect.h"
6 #define ARR_SIZE 1024
8 void __attribute__((noipa))
9 foo (int a[][ARR_SIZE], int *b)
11 int i;
12 for (i = 0; i < ARR_SIZE; ++i)
14 a[0][i] += b[0];
15 a[1][i] += b[1];
16 a[2][i] += b[2];
17 a[3][i] += b[3];
21 int
22 main ()
24 int a[4][ARR_SIZE];
25 int b[4];
27 check_vect ();
29 for (int i = 0; i < 4; ++i)
31 b[i] = 20 * i;
32 for (int j = 0; j < ARR_SIZE; ++j)
33 a[i][j] = (i + 1) * ARR_SIZE - j;
36 foo (a, b);
38 for (int i = 0; i < 4; ++i)
39 #pragma GCC novector
40 for (int j = 0; j < ARR_SIZE; ++j)
41 if (a[i][j] != (i + 1) * ARR_SIZE - j + 20 * i)
42 __builtin_abort ();
44 return 0;
48 /* See that we do not try to vectorize the uniform CTORs. */
49 /* { dg-final { scan-tree-dump-not "Analyzing vectorizable constructor" "slp1" } } */