Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / bb-slp-pattern-2.c
blobd32cb758591bf86f32f97a30977347908ec61559
1 /* { dg-require-effective-target vect_condition } */
2 /* { dg-additional-options "-fno-tree-vectorize -ftree-slp-vectorize -ftree-loop-if-convert" } */
4 #include "tree-vect.h"
6 #define N 128
8 __attribute__((noinline, noclone)) void
9 foo (short * __restrict__ a, int * __restrict__ b, int stride)
11 int i;
13 for (i = 0; i < N/stride; i++, a += stride, b += stride)
15 a[0] = b[0] ? 1 : 7;
16 a[1] = b[1] ? 2 : 0;
17 a[2] = b[2] ? 3 : 0;
18 a[3] = b[3] ? 4 : 0;
19 a[4] = b[4] ? 5 : 0;
20 a[5] = b[5] ? 6 : 0;
21 a[6] = b[6] ? 7 : 0;
22 a[7] = b[7] ? 8 : 0;
26 short a[N];
27 int b[N];
28 int main ()
30 int i;
32 check_vect ();
34 for (i = 0; i < N; i++)
36 a[i] = i;
37 b[i] = -i;
40 foo (a, b, 8);
42 for (i = 1; i < N; i++)
43 if (a[i] != i%8 + 1)
44 abort ();
46 if (a[0] != 7)
47 abort ();
49 return 0;
52 /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target { vect_element_align && vect_pack_trunc } } } } */