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 
5 #include <stdarg.h>
6 #include "tree-vect.h"
7 
8 #define N 16
9 
10 unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
11 unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
12 
13 /* Vectorization of reduction using loop-aware SLP (with unrolling).  */
14 
15 __attribute__ ((noinline))
main1(int n,int res0,int res1,int res2,int res3)16 int main1 (int n, int res0, int res1, int res2, int res3)
17 {
18   int i;
19   unsigned int udiff0 = 5, udiff1 = 10;
20 
21   for (i = 0; i < n; i++) {
22     udiff1 += (ub[2*i + 1] - uc[2*i + 1]);
23     udiff0 += (ub[2*i] - uc[2*i]);
24   }
25 
26   /* Check results:  */
27   if (udiff0 != res0
28       || udiff1 != res1)
29     abort ();
30 
31   return 0;
32 }
33 
main(void)34 int main (void)
35 {
36   check_vect ();
37 
38   main1 (N/2, 117, 138, 84, 102);
39   return 0;
40 }
41 
42 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_add } } } */
43 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_add } } } */
44 
45