PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-117.c
blob22f8e01187272e2cfe445c66ca590f77923d4e95
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 5
8 static int a[N][N] = {{ 1, 2, 3, 4, 5},
9 { 6, 7, 8, 9,10},
10 {11,12,13,14,15},
11 {16,17,18,19,20},
12 {21,22,23,24,25}};
14 static int c[N][N] = {{ 1, 2, 3, 4, 5},
15 { 7, 9,11, 13,15},
16 {18,21,24,27,30},
17 {34,38,42,46,50},
18 {55,60,65,70,75}};
20 __attribute__ ((noinline))
21 int main1 (int A[N][N], int n)
24 int i,j;
26 /* vectorizable */
27 for (i = 1; i < N; i++)
29 for (j = 0; j < n; j++)
31 A[i][j] = A[i-1][j] + A[i][j];
35 return 0;
38 int main (void)
40 int i,j;
42 check_vect ();
44 main1 (a, N);
46 /* check results: */
48 for (i = 0; i < N; i++)
50 for (j = 0; j < N; j++)
52 if (a[i][j] != c[i][j])
53 abort();
56 return 0;
59 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
60 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */