Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-outer-4d.c
blobc344fb1d67b39533cc79e4f47e129be3825bbdb3
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 40
7 #define M 128
8 float in[N+M];
9 float out[N];
11 /* Outer-loop vectorization. */
13 __attribute__ ((noinline)) void
14 foo (){
15 int i,j;
16 float diff;
18 for (i = 0; i < N; i++) {
19 diff = 0;
20 for (j = 0; j < M; j+=4) {
21 diff += in[j+i];
23 out[i]=diff;
27 int main (void)
29 check_vect ();
30 int i, j;
31 float diff;
33 for (i = 0; i < N; i++)
34 in[i] = i;
36 foo ();
38 for (i = 0; i < N; i++) {
39 diff = 0;
40 for (j = 0; j < M; j+=4) {
41 diff += in[j+i];
43 if (out[i] != diff)
44 abort ();
47 return 0;
50 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
51 /* { dg-final { cleanup-tree-dump "vect" } } */