* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-104.c
blobc7478382915cd05ebeed39c7664f09db1fd42318
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "--param max-completely-peel-times=1" } */
4 #include <stdlib.h>
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 3
10 struct extraction
12 int a[N][N];
13 int b[N][N];
16 static int a[N][N] = {{1,2,3},{4,5,6},{7,8,9}};
17 static int b[N][N] = {{17,24,7},{0,2,3},{4,31,82}};
18 static int c[N][N] = {{1,2,3},{4,5,5},{5,5,5}};
19 volatile int foo;
21 __attribute__ ((noinline))
22 int main1 (int x) {
23 int i,j;
24 struct extraction *p;
25 p = (struct extraction *) malloc (sizeof (struct extraction));
27 for (i = 0; i < N; i++)
29 for (j = 0; j < N; j++)
31 p->a[i][j] = a[i][j];
32 p->b[i][j] = b[i][j];
33 if (foo == 135)
34 abort (); /* to avoid vectorization */
38 /* Not vectorizable: distance = 1. */
39 for (i = 1; i < N; i++)
41 for (j = 0; j < N; j++)
43 *((int *)p + x + i + j + 1) = *((int *)p + x + i + j);
47 /* check results: */
48 for (i = 0; i < N; i++)
50 for (j = 0; j < N; j++)
52 if (p->a[i][j] != c[i][j])
53 abort();
56 return 0;
59 int main (void)
61 check_vect ();
63 foo = 0;
64 return main1 (N);
67 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
68 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */
69 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_multiple_sizes } } } */