openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-gather-2.c
blob10e64e64d47511825def499faf6523d0b8dde61a
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 /* Different base. */
12 y[i * 2] = x1[indices[i * 2]] + 1;
13 y[i * 2 + 1] = x2[indices[i * 2 + 1]] + 2;
17 void
18 f2 (int *restrict y, int *restrict x, int *restrict indices)
20 for (int i = 0; i < N; ++i)
22 /* Different scale. */
23 y[i * 2] = *(int *)((char *)x + (__UINTPTR_TYPE__)indices[i * 2] * 4) + 1;
24 y[i * 2 + 1] = *(int *)((char *)x + (__UINTPTR_TYPE__)indices[i * 2 + 1] * 2) + 2;
28 void
29 f3 (int *restrict y, int *restrict x, int *restrict indices)
31 for (int i = 0; i < N; ++i)
33 /* Different type. */
34 y[i * 2] = x[indices[i * 2]] + 1;
35 y[i * 2 + 1] = x[((unsigned int *) indices)[i * 2 + 1]] + 2;
39 /* { dg-final { scan-tree-dump "different gather base" vect { target { ! vect_gather_load_ifn } } } } */
40 /* { dg-final { scan-tree-dump "different gather scale" vect { target { ! vect_gather_load_ifn } } } } */