Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-strided-a-u16-i2.c
blob3b40e225d341b5bce04d29a0e0eaf963dec9a4b3
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
8 typedef struct {
9 unsigned short a;
10 unsigned short b;
11 } s;
13 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->b - ptr->a;
32 res[i].b = ptr->b + ptr->a;
33 ptr++;
36 /* check results: */
37 for (i = 0; i < N; i++)
39 if (res[i].a != arr[i].b - arr[i].a
40 || res[i].b != arr[i].a + arr[i].b)
41 abort ();
44 return 0;
47 int main (void)
49 int i;
51 check_vect ();
53 main1 ();
55 return 0;
58 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided } } } */
59 /* { dg-final { cleanup-tree-dump "vect" } } */