Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / vect / vect-105.c
blobaa1ea1c98296ee7924c348765b29a2258527690d
1 /* { dg-require-effective-target vect_int } */
3 #include <stdlib.h>
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 4
9 struct extraction
11 int a[N][N];
12 int b[N][N];
15 static int a[N][N] = {{1,2,3,11},{4,5,6,12},{7,8,9,13},{34,45,67,83}};
16 static int b[N][N] = {{17,28,15,23},{0,2,3,24},{4,31,82,25},{29,31,432,256}};
17 static int c[N][N] = {{1,2,3,11},{4,9,13,34},{45,67,83,13},{34,45,67,83}};
19 int main1 (int x) {
20 int i,j;
21 struct extraction *p;
22 p = (struct extraction *) malloc (sizeof (struct extraction));
24 for (i = 0; i < N; i++)
26 for (j = 0; j < N; j++)
28 p->a[i][j] = a[i][j];
29 p->b[i][j] = b[i][j];
30 if (x == 135)
31 abort (); /* to avoid vectorization */
35 /* Vectorizable: distance > number of iterations. */
36 for (i = 1; i < N; i++)
38 for (j = 0; j < N; j++)
40 *((int *)p + x + i + j) = *((int *)p + x + i + j + 5);
44 /* check results: */
45 for (i = 0; i < N; i++)
47 for (j = 0; j < N; j++)
49 if (p->a[i][j] != c[i][j])
50 abort();
53 return 0;
56 int main (void)
58 check_vect ();
60 return main1 (N);
63 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
64 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */
65 /* { dg-final { cleanup-tree-dump "vect" } } */