RISC-V: fix zcmp popretz [PR113715]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-24.c
blob8c769281164774e4a72760c7e6042f16a1a48154
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #define N 64
11 __attribute__ ((noinline)) int
12 main1 ()
14 int i;
15 int ia[N];
16 int ib[N]=
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 1,1,0,0,1,0,1,0,
24 1,1,0,0,1,0,1,0};
25 int ic[N] =
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,
32 1,1,0,0,1,0,1,0,
33 1,1,0,0,1,0,1,0};
35 char ca[N];
36 char cb[N] =
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,
43 1,1,0,0,1,0,1,0,
44 1,1,0,0,1,0,1,0};
46 char cc[N] =
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,
53 1,1,0,0,1,0,1,0,
54 1,1,0,0,1,0,1,0};
56 short sa[N];
57 short sb[N] =
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,
64 1,1,0,0,1,0,1,0,
65 1,1,0,0,1,0,1,0};
67 short sc[N] =
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,
74 1,1,0,0,1,0,1,0,
75 1,1,0,0,1,0,1,0};
77 /* Check ints. */
79 for (i = 0; i < N; i++)
81 ia[i] = (ib[i] || ic[i]);
84 /* check results: */
85 #pragma GCC novector
86 for (i = 0; i <N; i++)
88 if (ia[i] != (ib[i] || ic[i]))
89 abort ();
92 /* Check chars. */
94 for (i = 0; i < N; i++)
96 ca[i] = (cb[i] || cc[i]);
99 /* check results: */
100 #pragma GCC novector
101 for (i = 0; i <N; i++)
103 if (ca[i] != (cb[i] || cc[i]))
104 abort ();
107 /* Check shorts. */
109 for (i = 0; i < N; i++)
111 sa[i] = (sb[i] || sc[i]);
114 /* check results: */
115 #pragma GCC novector
116 for (i = 0; i <N; i++)
118 if (sa[i] != (sb[i] || sc[i]))
119 abort ();
122 return 0;
125 int main (void)
127 check_vect ();
129 return main1 ();
131 /* The short-cutting || is if-converted using COND_EXPRs rather than
132 bitwise or. */
133 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail { ! vect_condition } } } } */
134 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
135 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */