cfgexpand: Expand comment on when non-var clobbers can show up
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-21.c
blobc063bcbad3612a1a33b1a6d604e345ee1ea90e9c
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
3 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 64
10 int ia[N];
11 int ib[N]=
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 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];
83 /* check results: */
84 #pragma GCC novector
85 for (i = 0; i <N; i++)
87 if (ia[i] != !ib[i])
88 abort ();
91 /* Check chars. */
93 for (i = 0; i < N; i++)
95 ca[i] = !cb[i];
98 /* check results: */
99 #pragma GCC novector
100 for (i = 0; i <N; i++)
102 if (ca[i] != !cb[i])
103 abort ();
106 /* Check shorts. */
108 for (i = 0; i < N; i++)
110 sa[i] = !sb[i];
113 /* check results: */
114 #pragma GCC novector
115 for (i = 0; i <N; i++)
117 if (sa[i] != !sb[i])
118 abort ();
121 return 0;
124 int main (void)
126 check_vect ();
128 return main1 ();
131 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_condition } } } */
132 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
134 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */