c++: wrong error due to std::initializer_list opt [PR116476]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-gather-4.c
blobedd9a6783c256ec4b8f9492e00d78df3653361fb
1 /* { dg-do compile } */
3 #define N 16
5 void
6 f1 (int *restrict y, int *restrict x1, int *restrict x2,
7 int *restrict indices)
9 for (int i = 0; i < N; ++i)
11 y[i * 2] = (indices[i * 2] < N * 2
12 ? x1[indices[i * 2]] + 1
13 : 1);
14 y[i * 2 + 1] = (indices[i * 2 + 1] < N * 2
15 ? x2[indices[i * 2 + 1]] + 2
16 : 2);
20 void
21 f2 (int *restrict y, int *restrict x, int *restrict indices)
23 for (int i = 0; i < N; ++i)
25 y[i * 2] = (indices[i * 2] < N * 2
26 ? x[indices[i * 2]] + 1
27 : 1);
28 y[i * 2 + 1] = (indices[i * 2 + 1] < N * 2
29 ? x[indices[i * 2 + 1] * 2] + 2
30 : 2);
34 void
35 f3 (int *restrict y, int *restrict x, int *restrict indices)
37 for (int i = 0; i < N; ++i)
39 y[i * 2] = (indices[i * 2] < N * 2
40 ? x[indices[i * 2]] + 1
41 : 1);
42 y[i * 2 + 1] = (((unsigned int *)indices)[i * 2 + 1] < N * 2
43 ? x[((unsigned int *) indices)[i * 2 + 1]] + 2
44 : 2);
48 /* We do not want to see a two-lane .MASK_LOAD or .MASK_GATHER_LOAD since
49 the gathers are different on each lane. This is a bit fragile and
50 should possibly be turned into a runtime test. */
51 /* { dg-final { scan-tree-dump-not "stmt 1 \[^\r\n\]* = .MASK" vect } } */