2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-17.c
blob471a82336cf466856186eb9ad3f7a95e4087cedc
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 64
9 int ia[N];
10 int ib[N]=
11 {1,1,0,0,1,0,1,0,
12 1,1,0,0,1,0,1,0,
13 1,1,0,0,1,0,1,0,
14 1,1,0,0,1,0,1,0,
15 1,1,0,0,1,0,1,0,
16 1,1,0,0,1,0,1,0,
17 1,1,0,0,1,0,1,0,
18 1,1,0,0,1,0,1,0};
20 int ic[N] =
21 {1,1,0,0,1,0,1,0,
22 1,1,0,0,1,0,1,0,
23 1,1,0,0,1,0,1,0,
24 1,1,0,0,1,0,1,0,
25 1,1,0,0,1,0,1,0,
26 1,1,0,0,1,0,1,0,
27 1,1,0,0,1,0,1,0,
28 1,1,0,0,1,0,1,0};
30 char ca[N];
31 char cb[N] =
32 {1,1,0,0,1,0,1,0,
33 1,1,0,0,1,0,1,0,
34 1,1,0,0,1,0,1,0,
35 1,1,0,0,1,0,1,0,
36 1,1,0,0,1,0,1,0,
37 1,1,0,0,1,0,1,0,
38 1,1,0,0,1,0,1,0,
39 1,1,0,0,1,0,1,0};
41 char cc[N] =
42 {1,1,0,0,1,0,1,0,
43 1,1,0,0,1,0,1,0,
44 1,1,0,0,1,0,1,0,
45 1,1,0,0,1,0,1,0,
46 1,1,0,0,1,0,1,0,
47 1,1,0,0,1,0,1,0,
48 1,1,0,0,1,0,1,0,
49 1,1,0,0,1,0,1,0};
51 short sa[N];
52 short sb[N] =
53 {1,1,0,0,1,0,1,0,
54 1,1,0,0,1,0,1,0,
55 1,1,0,0,1,0,1,0,
56 1,1,0,0,1,0,1,0,
57 1,1,0,0,1,0,1,0,
58 1,1,0,0,1,0,1,0,
59 1,1,0,0,1,0,1,0,
60 1,1,0,0,1,0,1,0};
62 short sc[N] =
63 {1,1,0,0,1,0,1,0,
64 1,1,0,0,1,0,1,0,
65 1,1,0,0,1,0,1,0,
66 1,1,0,0,1,0,1,0,
67 1,1,0,0,1,0,1,0,
68 1,1,0,0,1,0,1,0,
69 1,1,0,0,1,0,1,0,
70 1,1,0,0,1,0,1,0};
72 __attribute__ ((noinline)) int
73 main1 ()
75 int i;
76 /* Check ints. */
78 for (i = 0; i < N; i++)
80 ia[i] = ib[i] & ic[i];
83 /* check results: */
84 for (i = 0; i <N; i++)
86 if (ia[i] != (ib[i] & ic[i]))
87 abort ();
90 /* Check chars. */
92 for (i = 0; i < N; i++)
94 ca[i] = cb[i] & cc[i];
97 /* check results: */
98 for (i = 0; i <N; i++)
100 if (ca[i] != (cb[i] & cc[i]))
101 abort ();
104 /* Check shorts. */
106 for (i = 0; i < N; i++)
108 sa[i] = sb[i] & sc[i];
111 /* check results: */
112 for (i = 0; i <N; i++)
114 if (sa[i] != (sb[i] & sc[i]))
115 abort ();
118 return 0;
121 int main (void)
123 check_vect ();
125 return main1 ();
128 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
129 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */