PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-store.c
blobe8303b63bd4812e0643dc96888eeee2ea8ca082a
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 void __attribute__((noinline))
7 sumit (float * __restrict dest,
8 float * __restrict src, float * __restrict src2,
9 int stride, int n)
11 int i;
12 for (i = 0; i < n; i++)
13 dest[i*stride] = src[i] + src2[i];
16 int main()
18 int i, stride;
19 float src[] = {1, 2, 3, 4, 5, 6, 7, 8};
20 float dest[64];
21 check_vect ();
22 for (stride = 0; stride < 8; stride++)
24 sumit (dest, src, src, stride, 8);
25 if (!stride && dest[0] != 16)
26 abort();
27 else if (stride)
28 for (i = 0; i < 8; i++)
29 if (2*src[i] != dest[i*stride])
30 abort ();
32 return 0;
35 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */