Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-u8-i2-gap.c
blobb18b6605851173ce6d22a697d25093dea30b30a7
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
8 typedef struct {
9 unsigned char a;
10 unsigned char b;
11 } s;
13 __attribute__ ((noinline)) int
14 main1 (s *arr)
16 s *ptr = arr;
17 s res[N];
18 int i;
20 for (i = 0; i < N; i++)
22 res[i].a = ptr->b;
23 res[i].b = ptr->b;
24 ptr++;
27 /* check results: */
28 for (i = 0; i < N; i++)
30 if (res[i].a != arr[i].b
31 || res[i].b != arr[i].b)
32 abort ();
35 ptr = arr;
36 /* Not vectorizable: gap in store. */
37 for (i = 0; i < N; i++)
39 res[i].a = ptr->b;
40 ptr++;
43 /* check results: */
44 for (i = 0; i < N; i++)
46 if (res[i].a != arr[i].b)
47 abort ();
51 return 0;
54 int main (void)
56 int i;
57 s arr[N];
59 check_vect ();
61 for (i = 0; i < N; i++)
63 arr[i].a = i;
64 arr[i].b = i * 2;
65 if (arr[i].a == 178)
66 abort();
69 main1 (arr);
71 return 0;
74 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
75 /* { dg-final { cleanup-tree-dump "vect" } } */