openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-vfa-03.c
blob2a94c73907e813019fcfbc912a1599f7423e2a47
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 struct S
9 unsigned short a;
10 unsigned short b;
13 struct S result[N] = {20, 13, 22, 14, 24, 15, 26, 16, 28, 17, 30, 18,
14 32, 19, 34, 20, 36, 21, 38, 22, 40, 23, 42, 24,
15 44, 25, 46, 26, 48, 27, 50, 28};
16 struct S X[N] = {10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16,
17 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
18 23, 23, 24, 24, 25, 25};
19 struct S Y[N] = {};
21 __attribute__ ((noinline)) void
22 foo (struct S * in, struct S * out)
24 int i;
26 for (i = 0; i < N; i++)
28 out[i].a = in[i].a * 2;
29 out[i].b = in[i].b + 3;
33 int
34 main (void)
36 int i;
38 check_vect ();
40 foo (X, Y);
42 /* check results: */
43 #pragma GCC novector
44 for (i = 0; i < N; i++)
46 if (Y[i].a != result[i].a)
47 abort ();
49 if (Y[i].b != result[i].b)
50 abort ();
53 return 0;
56 /* Needs interleaving support. */
57 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
58 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided2 } } } */