openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-41.c
blobb96de4fbcb7f9a3c60b884a47bbfc52ebbe1dd44
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_pack_trunc } */
3 /* { dg-require-effective-target vect_unpack } */
4 /* { dg-require-effective-target vect_hw_misalign } */
6 #include "tree-vect.h"
8 void __attribute__((noinline,noclone))
9 testi (int *p, short *q, int stride, int n)
11 int i;
12 for (i = 0; i < n; ++i)
14 q[i*4+0] = p[i*stride+0];
15 q[i*4+1] = p[i*stride+1];
16 q[i*4+2] = p[i*stride+2];
17 q[i*4+3] = p[i*stride+3];
21 void __attribute__((noinline,noclone))
22 testi2 (int *q, short *p, int stride, int n)
24 int i;
25 for (i = 0; i < n; ++i)
27 q[i*4+0] = p[i*stride+0];
28 q[i*4+1] = p[i*stride+1];
29 q[i*4+2] = p[i*stride+2];
30 q[i*4+3] = p[i*stride+3];
34 int ia[256];
35 short sa[256];
37 extern void abort (void);
39 int main()
41 int i;
43 check_vect ();
45 for (i = 0; i < 256; ++i)
47 ia[i] = sa[i] = i;
48 __asm__ volatile ("");
50 testi (ia, sa, 8, 32);
51 #pragma GCC novector
52 for (i = 0; i < 128; ++i)
53 if (sa[i] != ia[(i / 4) * 8 + i % 4])
54 abort ();
56 for (i = 0; i < 256; ++i)
58 ia[i] = sa[i] = i;
59 __asm__ volatile ("");
61 testi2 (ia, sa, 8, 32);
62 #pragma GCC novector
63 for (i = 0; i < 128; ++i)
64 if (ia[i] != sa[(i / 4) * 8 + i % 4])
65 abort ();
67 return 0;
70 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */