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