libstdc++: Add script to update docs for a new release branch
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / O3-slp-reduc-10.c
blob42a59f4a155e745566b120e2855cc20bfce83369
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
7 #define TYPE int
8 #define RESULT 755918
10 __attribute__ ((noinline)) TYPE fun2 (TYPE *x, TYPE *y, unsigned int n)
12 int i, j;
13 TYPE dot = 14;
15 for (i = 0; i < n / 2; i++)
16 for (j = 0; j < 2; j++)
17 dot += *(x++) * *(y++);
19 return dot;
22 int main (void)
24 TYPE a[N], b[N], dot;
25 int i;
27 check_vect ();
29 for (i = 0; i < N; i++)
31 a[i] = i;
32 b[i] = i+8;
35 dot = fun2 (a, b, N);
36 if (dot != RESULT)
37 abort();
39 return 0;
42 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_int_mult && {! vect_no_align } } } } } */