Tighten condition in vect/pr85586.c (PR 85654)
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-23.c
blob69e0848c8eca10661d85a2f0b17b9a3d99319135
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_condition } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 64
9 __attribute__ ((noinline)) int
10 main1 ()
12 int i;
13 int ia[N];
14 int ib[N]=
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 1,1,0,0,1,0,1,0,
20 1,1,0,0,1,0,1,0,
21 1,1,0,0,1,0,1,0,
22 1,1,0,0,1,0,1,0};
23 int ic[N] =
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 1,1,0,0,1,0,1,0,
30 1,1,0,0,1,0,1,0,
31 1,1,0,0,1,0,1,0};
33 char ca[N];
34 char cb[N] =
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 1,1,0,0,1,0,1,0,
41 1,1,0,0,1,0,1,0,
42 1,1,0,0,1,0,1,0};
44 char cc[N] =
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 1,1,0,0,1,0,1,0,
51 1,1,0,0,1,0,1,0,
52 1,1,0,0,1,0,1,0};
54 short sa[N];
55 short sb[N] =
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 1,1,0,0,1,0,1,0,
62 1,1,0,0,1,0,1,0,
63 1,1,0,0,1,0,1,0};
65 short sc[N] =
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 1,1,0,0,1,0,1,0,
72 1,1,0,0,1,0,1,0,
73 1,1,0,0,1,0,1,0};
75 /* Check ints. */
77 for (i = 0; i < N; i++)
79 ia[i] = ib[i] && ic[i];
82 /* check results: */
83 for (i = 0; i <N; i++)
85 if (ia[i] != ib[i] && ic[i])
86 abort ();
89 /* Check chars. */
91 for (i = 0; i < N; i++)
93 ca[i] = cb[i] && cc[i];
96 /* check results: */
97 for (i = 0; i <N; i++)
99 if (ca[i] != cb[i] && cc[i])
100 abort ();
103 /* Check shorts. */
105 for (i = 0; i < N; i++)
107 sa[i] = sb[i] && sc[i];
110 /* check results: */
111 for (i = 0; i <N; i++)
113 if (sa[i] != sb[i] && sc[i])
114 abort ();
117 return 0;
120 int main (void)
122 check_vect ();
124 return main1 ();
127 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
128 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */