libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-86.c
blob83c0cd039b5696c1bef18f14e9f538c43f961dac
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
3 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 16
10 int a[N];
12 __attribute__ ((noinline))
13 int main1 (int n)
15 int i, j, k;
16 int b[N];
18 for (i = 0; i < n; i++)
20 for (j = 0; j < n; j++)
22 k = i + n;
23 a[j] = k;
25 b[i] = k;
28 #pragma GCC novector
29 for (j = 0; j < n; j++)
30 if (a[j] != i + n - 1)
31 abort();
33 #pragma GCC novector
34 for (i = 0; i < n; i++)
35 if (b[i] != i + n)
36 abort();
38 return 0;
41 int main (void)
43 check_vect ();
45 main1 (N);
46 main1 (0);
47 main1 (1);
48 main1 (2);
49 main1 (N-1);
51 return 0;
54 /* Fails for targets that don't vectorize PLUS (e.g alpha). */
55 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
56 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
57 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
58 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */