1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
3 
4 #include <stdarg.h>
5 #include "tree-vect.h"
6 
7 #define N 64
8 
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};
19 
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};
29 
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};
40 
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};
50 
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};
61 
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};
71 
72 __attribute__ ((noinline)) int
main1()73 main1 ()
74 {
75   int i;
76   /* Check ints.  */
77 
78   for (i = 0; i < N; i++)
79     {
80       ia[i] = ib[i] & ic[i];
81     }
82 
83   /* check results:  */
84   for (i = 0; i <N; i++)
85     {
86       if (ia[i] != (ib[i] & ic[i]))
87         abort ();
88     }
89 
90   /* Check chars.  */
91 
92   for (i = 0; i < N; i++)
93     {
94       ca[i] = cb[i] & cc[i];
95     }
96 
97   /* check results:  */
98   for (i = 0; i <N; i++)
99     {
100       if (ca[i] != (cb[i] & cc[i]))
101         abort ();
102     }
103 
104   /* Check shorts.  */
105 
106   for (i = 0; i < N; i++)
107     {
108       sa[i] = sb[i] & sc[i];
109     }
110 
111   /* check results:  */
112   for (i = 0; i <N; i++)
113     {
114       if (sa[i] != (sb[i] & sc[i]))
115         abort ();
116     }
117 
118   return 0;
119 }
120 
main(void)121 int main (void)
122 {
123   check_vect ();
124 
125   return main1 ();
126 }
127 
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" } } */
130