This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-87.c
blobba18eaa91c40cc8d01c9e8da17440f6b25d210c6
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 typedef int aint __attribute__ ((__aligned__(16)));
10 int main1 (int n, int *a)
12 int i, j, k;
13 int b[N];
15 for (i = 0; i < n; i++)
17 for (j = 0; j < n; j++)
19 k = i + n;
20 a[j] = k;
22 b[i] = k;
26 for (j = 0; j < n; j++)
27 if (a[j] != i + n - 1)
28 abort();
30 for (j = 0; j < n; j++)
31 if (b[j] != j + n)
32 abort();
34 return 0;
37 int main (void)
39 aint a[N];
41 check_vect ();
43 main1 (N, a);
44 main1 (0, a);
45 main1 (1, a);
46 main1 (2, a);
47 main1 (N-1, a);
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" { xfail alpha*-*-* } } } */
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" 1 "vect" { xfail alpha*-*-* } } } */