PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-20.c
blob8d759f3c6a66e6a6e318510ba59196ab91b757ac
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 signed char ca[N];
21 signed char cb[N] =
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 1,1,0,0,1,0,1,0};
31 short sa[N];
32 short sb[N] =
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 1,1,0,0,1,0,1,0};
42 __attribute__ ((noinline)) int
43 main1 ()
45 int i;
47 /* Check ints. */
49 for (i = 0; i < N; i++)
51 ia[i] = ~ib[i];
54 /* check results: */
55 for (i = 0; i <N; i++)
57 if (ia[i] != ~ib[i])
58 abort ();
61 /* Check chars. */
63 for (i = 0; i < N; i++)
65 ca[i] = ~cb[i];
68 /* check results: */
69 for (i = 0; i <N; i++)
71 if (ca[i] != ~cb[i])
72 abort ();
75 /* Check shorts. */
77 for (i = 0; i < N; i++)
79 sa[i] = ~sb[i];
82 /* check results: */
83 for (i = 0; i <N; i++)
85 if (sa[i] != ~sb[i])
86 abort ();
89 return 0;
92 int main (void)
94 check_vect ();
96 return main1 ();
99 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
100 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */