libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-reduc-6.c
blob5566705a70408108b6aa5bd81d7d7a6f00250257
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 } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 128
10 int a[N], b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 /* Vectorization of reduction. Loop-aware SLP is not possible, because of
13 different arrays. */
15 __attribute__ ((noinline))
16 int main1 (int n, int res0, int res1)
18 int i;
19 int sum0 = 0, sum1 = 0;
21 for (i = 0; i < n; i++) {
22 sum1 += a[2*i];
23 sum0 += b[2*i];
26 /* Check results: */
27 if (sum0 != res0
28 || sum1 != res1)
29 abort ();
31 return 0;
34 int main (void)
36 int i;
38 check_vect ();
40 for (i = 0; i < N; i++)
41 a[i] = b[i] = i;
43 main1 (N/2, 4032, 4032);
44 return 0;
47 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! { vect_unpack || vect_strided2 } } } } } } */
48 /* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } } } } */