Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-a-u8-i2-gap.c
blobcda57393538c69c1cf904f61ae3943b7b201d372
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 ()
16 s arr[N];
17 s *ptr = arr;
18 s res[N];
19 int i;
21 for (i = 0; i < N; i++)
23 arr[i].a = i;
24 arr[i].b = i * 2;
25 if (arr[i].a == 178)
26 abort();
29 for (i = 0; i < N; i++)
31 res[i].a = ptr->a;
32 res[i].b = ptr->a;
33 ptr++;
36 /* check results: */
37 for (i = 0; i < N; i++)
39 if (res[i].a != arr[i].a
40 || res[i].b != arr[i].a)
41 abort ();
44 ptr = arr;
45 /* Not vectorizable: gap in store. */
46 for (i = 0; i < N; i++)
48 res[i].a = ptr->b;
49 ptr++;
52 /* check results: */
53 for (i = 0; i < N; i++)
55 if (res[i].a != arr[i].b)
56 abort ();
60 return 0;
63 int main (void)
65 check_vect ();
67 main1 ();
69 return 0;
72 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
73 /* { dg-final { cleanup-tree-dump "vect" } } */