libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-8.c
blob8647249f546267185bb5c232f088a4c0984f2039
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 32
8 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
10 int main1 ()
12 int i;
13 float fa[N];
15 /* int -> float */
16 for (i = 0; i < N/4; i++)
18 fa[4*i] = (float) ib[4*i];
19 fa[4*i + 1] = (float) ib[4*i + 1];
20 fa[4*i + 2] = (float) ib[4*i + 2];
21 fa[4*i + 3] = (float) ib[4*i + 3];
24 /* check results: */
25 #pragma GCC novector
26 for (i = 0; i < N/4; i++)
28 if (fa[4*i] != (float) ib[4*i]
29 || fa[4*i + 1] != (float) ib[4*i + 1]
30 || fa[4*i + 2] != (float) ib[4*i + 2]
31 || fa[4*i + 3] != (float) ib[4*i + 3])
32 abort ();
35 return 0;
38 int main (void)
40 check_vect ();
42 return main1 ();
45 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
46 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */