libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-simd-clone-1.c
blob6ccbb39b5670fb3c09ae9fdbcdf59d3d9d4b3310
1 /* { dg-require-effective-target vect_simd_clones } */
2 /* { dg-additional-options "-fopenmp-simd" } */
4 #include "tree-vect.h"
6 int x[1024];
8 #pragma omp declare simd simdlen(4) notinbranch
9 __attribute__((noinline)) int
10 foo (int a, int b)
12 return a + b;
15 void __attribute__((noipa))
16 bar (void)
18 #pragma omp simd
19 for (int i = 0; i < 512; i++)
21 x[2*i+0] = foo (x[2*i+0], x[2*i+0]);
22 x[2*i+1] = foo (x[2*i+1], x[2*i+1]);
26 int
27 main ()
29 int i;
30 check_vect ();
32 #pragma GCC novector
33 for (i = 0; i < 1024; i++)
34 x[i] = i;
36 bar ();
38 #pragma GCC novector
39 for (i = 0; i < 1024; i++)
40 if (x[i] != i + i)
41 abort ();
43 return 0;
46 /* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" } } */