Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-strided-a-u8-i8-gap2.c
blob4fb5494a4d35e773621cd035a5bfbaf741d7b4fd
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 typedef struct {
9 unsigned char a;
10 unsigned char b;
11 unsigned char c;
12 unsigned char d;
13 unsigned char e;
14 unsigned char f;
15 unsigned char g;
16 unsigned char h;
17 } s;
19 __attribute__ ((noinline)) int
20 main1 ()
22 int i;
23 s arr[N];
24 s *ptr = arr;
25 s res[N];
27 for (i = 0; i < N; i++)
29 arr[i].a = i;
30 arr[i].b = i * 2;
31 arr[i].c = 17;
32 arr[i].d = i+34;
33 arr[i].e = i + 5;
34 arr[i].f = i * 2 + 2;
35 arr[i].g = i - 3;
36 arr[i].h = 56;
37 if (arr[i].a == 178)
38 abort();
41 for (i = 0; i < N; i++)
43 res[i].c = ptr->a;
44 res[i].a = ptr->f + ptr->a;
45 res[i].d = ptr->f - ptr->a;
46 res[i].b = ptr->f;
47 res[i].f = ptr->a;
48 res[i].e = ptr->f - ptr->a;
49 res[i].h = ptr->f;
50 res[i].g = ptr->f - ptr->a;
51 ptr++;
54 /* check results: */
55 for (i = 0; i < N; i++)
57 if (res[i].c != arr[i].a
58 || res[i].a != arr[i].f + arr[i].a
59 || res[i].d != arr[i].f - arr[i].a
60 || res[i].b != arr[i].f
61 || res[i].f != arr[i].a
62 || res[i].e != arr[i].f - arr[i].a
63 || res[i].h != arr[i].f
64 || res[i].g != arr[i].f - arr[i].a)
65 abort();
70 int main (void)
72 check_vect ();
74 main1 ();
76 return 0;
79 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
80 /* { dg-final { cleanup-tree-dump "vect" } } */