PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-outer-4d-big-array.c
blobb656064697c93177cb9cd9aae8f9f278b9af40b0
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 320
7 #define M 1024
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" } } */