libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-vfa-vect-102.c
blob9a3fdab128a3bf2609018f92a38a7a6de8b7270b
1 /* { dg-require-effective-target vect_int } */
3 #include <stdlib.h>
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 9
9 struct extraction
11 int a[N];
12 int b[N];
15 static int a[N] = {1,2,3,4,5,6,7,8,9};
16 static int b[N] = {2,3,4,5,6,7,8,9,9};
18 __attribute__ ((noinline))
19 int main1 (int x, int y) {
20 int i;
21 struct extraction *p;
22 p = (struct extraction *) malloc (sizeof (struct extraction));
24 for (i = 0; i < N; i++)
26 p->a[i] = a[i];
27 asm volatile ("" ::: "memory");
30 /* Not vectorizable: distance 1. */
31 #pragma GCC unroll 0
32 for (i = 0; i < N - 1; i++)
34 *((int *)p + x + i + 1) = *((int *)p + x + i);
37 /* check results: */
38 #pragma GCC novector
39 for (i = 0; i < N; i++)
41 if (p->a[i] != 1)
42 abort();
44 return 0;
47 int main (void)
49 check_vect ();
51 return main1 (0, N);
54 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
55 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */
56 /* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */