Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-86.c
blob334e54ee46ddf88fa4d78e9f79ceb1a6daf5d061
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 int a[N];
10 __attribute__ ((noinline))
11 int main1 (int n)
13 int i, j, k;
14 int b[N];
16 for (i = 0; i < n; i++)
18 for (j = 0; j < n; j++)
20 k = i + n;
21 a[j] = k;
23 b[i] = k;
27 for (j = 0; j < n; j++)
28 if (a[j] != i + n - 1)
29 abort();
31 for (i = 0; i < n; i++)
32 if (b[i] != i + n)
33 abort();
35 return 0;
38 int main (void)
40 check_vect ();
42 main1 (N);
43 main1 (0);
44 main1 (1);
45 main1 (2);
46 main1 (N-1);
48 return 0;
51 /* Fails for targets that don't vectorize PLUS (e.g alpha). */
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
53 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
54 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
55 /* { dg-final { cleanup-tree-dump "vect" } } */