libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-vfa-02.c
blob4848215a7a8f5fea569c0bfaf5909ac68a81bbf2
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 int resultY[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
8 int resultZ[N] = {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28};
9 int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
10 int Y[N] = {};
11 int Z[N] = {};
13 __attribute__ ((noinline)) void
14 foo (int *in, int *out1, int *out2)
16 int i;
18 for (i = 0; i < N; i++)
20 out1[i] = in[i] + 2;
21 out2[i] = in[i] + 3;
25 int
26 main (void)
28 int i;
30 check_vect ();
32 foo (X, Y, Z);
34 /* check results: */
35 #pragma GCC novector
36 for (i = 0; i < N; i++)
38 if (Y[i] != resultY[i])
39 abort ();
41 if (Z[i] != resultZ[i])
42 abort ();
44 return 0;
47 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */