Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-u8-i8-gap2.c
blob259e91f491a6c1c4474702f01cd464ec502e9bef
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include <stdio.h>
5 #include "tree-vect.h"
7 #define N 16
9 typedef struct {
10 unsigned char a;
11 unsigned char b;
12 unsigned char c;
13 unsigned char d;
14 unsigned char e;
15 unsigned char f;
16 unsigned char g;
17 unsigned char h;
18 } s;
20 __attribute__ ((noinline)) int
21 main1 (s *arr)
23 int i;
24 s *ptr = arr;
25 s res[N];
27 for (i = 0; i < N; i++)
29 res[i].c = ptr->b;
30 res[i].a = ptr->f + ptr->b;
31 res[i].d = ptr->f - ptr->b;
32 res[i].b = ptr->f;
33 res[i].f = ptr->b;
34 res[i].e = ptr->f - ptr->b;
35 res[i].h = ptr->f;
36 res[i].g = ptr->f - ptr->b;
37 ptr++;
40 /* check results: */
41 for (i = 0; i < N; i++)
43 if (res[i].c != arr[i].b
44 || res[i].a != arr[i].f + arr[i].b
45 || res[i].d != arr[i].f - arr[i].b
46 || res[i].b != arr[i].f
47 || res[i].f != arr[i].b
48 || res[i].e != arr[i].f - arr[i].b
49 || res[i].h != arr[i].f
50 || res[i].g != arr[i].f - arr[i].b)
51 abort();
56 int main (void)
58 int i;
59 s arr[N];
61 check_vect ();
63 for (i = 0; i < N; i++)
65 arr[i].a = i;
66 arr[i].b = i * 2;
67 arr[i].c = 17;
68 arr[i].d = i+34;
69 arr[i].e = i + 5;
70 arr[i].f = i * 2 + 2;
71 arr[i].g = i - 3;
72 arr[i].h = 56;
73 if (arr[i].a == 178)
74 abort();
77 main1 (arr);
79 return 0;
82 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
83 /* { dg-final { cleanup-tree-dump "vect" } } */