2013-06-03 Teresa Johnson <tejohnson@google.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / bb-slp-25.c
blobb92535df00c628650d94c1ea92f3550000f5e02b
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define A 3
7 #define B 4
8 #define N 256
10 short src[N], dst[N];
12 void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy)
14 int i;
15 h /= 16;
16 for (i = 0; i < h; i++)
18 dst[0] += A*src[0] + src[stride];
19 dst[1] += A*src[1] + src[1+stride];
20 dst[2] += A*src[2] + src[2+stride];
21 dst[3] += A*src[3] + src[3+stride];
22 dst[4] += A*src[4] + src[4+stride];
23 dst[5] += A*src[5] + src[5+stride];
24 dst[6] += A*src[6] + src[6+stride];
25 dst[7] += A*src[7] + src[7+stride];
26 dst += 8;
27 src += 8;
28 if (dummy == 32)
29 abort ();
34 int main (void)
36 int i;
38 check_vect ();
40 for (i = 0; i < N; i++)
42 dst[i] = 0;
43 src[i] = i;
46 foo (dst, src, N, 8, 0);
48 for (i = 0; i < N/2; i++)
50 if (dst[i] != A * i + i + 8)
51 abort ();
54 return 0;
57 /* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_element_align } } } */
58 /* { dg-final { cleanup-tree-dump "slp" } } */