(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
graphite/
block-3.c
       1  /* { dg-require-effective-target size32plus } */
       2  /* { dg-require-effective-target run_expensive_tests }  PR testsuite/48283 */
       3  /* { dg-timeout-factor 4.0 } */
       4  
       5  #define DEBUG 0
       6  #if DEBUG
       7  #include <stdio.h>
       8  #endif
       9  
      10  #define N 24
      11  #define M 100
      12  
      13  int A[M][M][M], B[M][M], C[M][M];
      14  
      15  static int __attribute__((noinline))
      16  foo (void)
      17  {
      18    int i, j, k;
      19  
      20    /* These loops contain too few iterations to be blocked.  */
      21    for (i = 0; i < 24; i++)
      22      for (j = 0; j < 24; j++)
      23        for (k = 0; k < 24; k++)
      24          A[i][j][k] = B[i][k] * C[k][j];
      25  
      26    /* These loops should still be loop blocked.  */
      27    for (i = 0; i < M; i++)
      28      for (j = 0; j < M; j++)
      29        for (k = 0; k < M; k++)
      30          A[i][j][k] = B[i][k] * C[k][j];
      31  
      32    return A[0][0][0] + A[M-1][M-1][M-1];
      33  }
      34  
      35  extern void abort ();
      36  
      37  int
      38  main (void)
      39  {
      40    int i, j, res;
      41  
      42    for (i = 0; i < M; i++)
      43      for (j = 0; j < M; j++)
      44        {
      45  	B[i][j] = i;
      46  	C[i][j] = j;
      47        }
      48  
      49    res = foo ();
      50  
      51  #if DEBUG
      52    fprintf (stderr, "res = %d \n", res);
      53  #endif
      54  
      55    if (res != 9801)
      56      abort ();
      57  
      58    return 0;
      59  }
      60  
      61  /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */