PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-86.c
blobff1d41df23f1e1eaab7f066726d5217b48fadb57
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
9 int a[N];
11 __attribute__ ((noinline))
12 int main1 (int n)
14 int i, j, k;
15 int b[N];
17 for (i = 0; i < n; i++)
19 for (j = 0; j < n; j++)
21 k = i + n;
22 a[j] = k;
24 b[i] = k;
28 for (j = 0; j < n; j++)
29 if (a[j] != i + n - 1)
30 abort();
32 for (i = 0; i < n; i++)
33 if (b[i] != i + n)
34 abort();
36 return 0;
39 int main (void)
41 check_vect ();
43 main1 (N);
44 main1 (0);
45 main1 (1);
46 main1 (2);
47 main1 (N-1);
49 return 0;
52 /* Fails for targets that don't vectorize PLUS (e.g alpha). */
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
54 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
55 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */