LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-a-u16-i4.c
blob37ff3abe97d60d9b968addaee7812cb0b05b6f44
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 unsigned short c;
12 unsigned short d;
13 } s;
15 __attribute__ ((noinline)) int
16 main1 ()
18 s arr[N];
19 s *ptr = arr;
20 s res[N];
21 int i;
23 for (i = 0; i < N; i++)
25 arr[i].a = i;
26 arr[i].b = i * 2;
27 arr[i].c = 17;
28 arr[i].d = i+34;
29 asm volatile ("" ::: "memory");
32 for (i = 0; i < N; i++)
34 unsigned short x, y, z, w;
35 x = ptr->b - ptr->a;
36 y = ptr->d - ptr->c;
37 res[i].c = x + y;
38 z = ptr->a + ptr->c;
39 w = ptr->b + ptr->d;
40 res[i].a = z + w;
41 res[i].d = x + y;
42 res[i].b = x + y;
43 ptr++;
46 /* check results: */
47 for (i = 0; i < N; i++)
49 if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
50 || res[i].a != arr[i].a + arr[i].c + arr[i].b + arr[i].d
51 || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
52 || res[i].b != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
53 abort ();
56 return 0;
59 int main (void)
61 int i;
63 check_vect ();
65 main1 ();
67 return 0;
70 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */