libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-recurr-3.c
blob62f26b9648dfa400f8e9cbda7309e315fb2573d0
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_perm } */
4 #include "tree-vect.h"
6 void __attribute__((noipa))
7 foo (int * __restrict__ a, signed char * __restrict__ b, int * __restrict__ c)
9 int t = *c;
10 for (int i = 0; i < 64; ++i)
12 b[i] = a[i] - t;
13 t = a[i];
17 int a[64];
18 signed char b[64];
20 int
21 main ()
23 check_vect ();
24 for (int i = 0; i < 64; ++i)
26 a[i] = i;
27 __asm__ volatile ("" ::: "memory");
29 int c = 7;
30 foo (a, b, &c);
31 #pragma GCC novector
32 for (int i = 1; i < 64; ++i)
33 if (b[i] != a[i] - a[i-1])
34 abort ();
35 if (b[0] != -7)
36 abort ();
37 return 0;
40 /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" } } */