PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / bb-slp-subgroups-3.c
blob6ae9a8976865f5f0f6d87521003e847df7faef98
1 /* { dg-require-effective-target vect_int } */
2 /* PR tree-optimization/67682. */
4 #include "tree-vect.h"
6 int __attribute__((__aligned__(8))) a[8];
7 int __attribute__((__aligned__(8))) b[8];
9 __attribute__ ((noinline)) void
10 test ()
12 a[0] = b[0] + 1;
13 a[1] = b[1] + 2;
14 a[2] = b[2] + 3;
15 a[3] = b[3] + 4;
16 a[4] = b[0] * 3;
17 a[5] = b[2] * 4;
18 a[6] = b[4] * 5;
19 a[7] = b[6] * 7;
22 int
23 main (int argc, char **argv)
25 check_vect ();
27 for (int i = 0; i < 8; i++)
28 a[i] = 1;
29 for (int i = 0; i < 8; i++)
30 b[i] = i + 4;
31 __asm__ volatile ("" : : : "memory");
32 test (a, b);
33 __asm__ volatile ("" : : : "memory");
34 if ((a[0] != 5) || (a[1] != 7) || (a[2] != 9) || (a[3] != 11)
35 || (a[4] != 12) || (a[5] != 24) || (a[6] != 40) || (a[7] != 70))
36 abort ();
37 return 0;
40 /* { dg-final { scan-tree-dump-times "Basic block will be vectorized using SLP" 1 "slp2" } } */
41 /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */