PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / bb-slp-27.c
blob8ef8bb0961486fc8f70ce6db6c167ddb69066731
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define A 3
7 #define N 16
9 short src[N], dst[N];
11 void foo (int a)
13 dst[0] += a*src[0];
14 dst[1] += a*src[1];
15 dst[2] += a*src[2];
16 dst[3] += a*src[3];
17 dst[4] += a*src[4];
18 dst[5] += a*src[5];
19 dst[6] += a*src[6];
20 dst[7] += a*src[7];
24 int main (void)
26 int i;
28 check_vect ();
30 for (i = 0; i < N; i++)
32 dst[i] = 0;
33 src[i] = i;
36 foo (A);
38 for (i = 0; i < 8; i++)
40 if (dst[i] != A * i)
41 abort ();
44 return 0;
47 /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target { vect_int_mult && { vect_unpack && vect_pack_trunc } } } } } */