Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-vfa-01.c

raw
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7 int result[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
8 int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
9 int Y[N] = {};
10
11 __attribute__ ((noinline)) void
12 foo (int *in, int *out)
13 {
14 int i;
15
16 for (i = 0; i < N; i++)
17 out[i] = in[i] + 2;
18 }
19
20 int
21 main (void)
22 {
23 int i;
24
25 check_vect ();
26
27 foo (X, Y);
28
29 /* check results: */
30 #pragma GCC novector
31 for (i = 0; i < N; i++)
32 {
33 if (Y[i] != result[i])
34 abort ();
35 }
36 return 0;
37 }
38
39 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */