2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-117.c
blob920e29314c0eea3cc282a7609eada57ff4b3986e
1 /* { dg-require-effective-target vect_int } */
3 #include <stdlib.h>
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 5
9 static int a[N][N] = {{ 1, 2, 3, 4, 5},
10 { 6, 7, 8, 9,10},
11 {11,12,13,14,15},
12 {16,17,18,19,20},
13 {21,22,23,24,25}};
15 static int c[N][N] = {{ 1, 2, 3, 4, 5},
16 { 7, 9,11, 13,15},
17 {18,21,24,27,30},
18 {34,38,42,46,50},
19 {55,60,65,70,75}};
21 volatile int foo;
23 __attribute__ ((noinline))
24 int main1 (int A[N][N], int n)
27 int i,j;
29 /* vectorizable */
30 for (i = 1; i < N; i++)
32 for (j = 0; j < n; j++)
34 A[i][j] = A[i-1][j] + A[i][j];
38 return 0;
41 int main (void)
43 int i,j;
45 check_vect ();
47 foo = 0;
48 main1 (a, N);
50 /* check results: */
52 for (i = 0; i < N; i++)
54 for (j = 0; j < N; j++)
56 if (a[i][j] != c[i][j])
57 abort();
60 return 0;
63 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
64 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */
65 /* { dg-final { cleanup-tree-dump "vect" } } */