OSDN Git Service

* doc/loop.texi: Document possibility not to perform disambiguation
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-3.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7
8 /* Test vectorization of reduction of unsigned-int in the presence
9    of unknown-loop-bound.  */
10
11 int main1 (int n, int res)
12 {
13   int i;
14   unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
15   unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
16   unsigned int udiff;
17
18   udiff = 0;
19   for (i = 0; i < n; i++) {
20     udiff += (ub[i] - uc[i]);
21   }
22
23   /* check results:  */
24   if (udiff != res)
25     abort ();
26
27   return 0;
28 }
29
30 int main (void)
31
32   check_vect ();
33   
34   main1 (N, 240);
35   main1 (N-1, 210);
36   return 0;
37 }
38
39 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_add } } } */
40 /* { dg-final { cleanup-tree-dump "vect" } } */