1  /* { dg-require-effective-target vect_int } */
       2  
       3  #include <stdarg.h>
       4  #include "tree-vect.h"
       5  
       6  #define N 5
       7  
       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}};
      13  
      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}};
      19  
      20  __attribute__ ((noinline))
      21  int main1 (int A[N][N], int n) 
      22  {
      23  
      24    int i,j;
      25  
      26    /* vectorizable */
      27    for (i = 1; i < N; i++)
      28    {
      29      for (j = 0; j < n; j++)
      30      {
      31        A[i][j] = A[i-1][j] + A[i][j];
      32      }
      33    }
      34  
      35    return 0;
      36  }
      37  
      38  int main (void)
      39  { 
      40    int i,j;
      41  
      42    check_vect ();
      43  
      44    main1 (a, N);
      45  
      46    /* check results: */
      47  
      48    for (i = 0; i < N; i++)
      49     {
      50      for (j = 0; j < N; j++)
      51       {
      52         if (a[i][j] != c[i][j])
      53           abort();
      54       }
      55    }
      56    return 0;
      57  }
      58  
      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" } } */
      61