OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [block-7.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target size32plus } */
2
/* { dg-require-effective-target run_expensive_tests }  PR testsuite/48283 */
3
 
4
#define DEBUG 0
5
#if DEBUG
6
#include <stdio.h>
7
#endif
8
 
9
#define N 200
10
 
11
int A[N][N], B[N][N], C[N][N];
12
 
13
static void __attribute__((noinline))
14
matmult (void)
15
{
16
  int i, j, k;
17
 
18
  /* This should be blocked.  */
19
  for (i = 0; i < N; i++)
20
    for (j = 0; j < N; j++)
21
      {
22
        A[i][j] = 0;
23
        for (k = 0; k < N; k++)
24
          A[i][j] += B[i][k] * C[k][j];
25
      }
26
}
27
 
28
extern void abort ();
29
 
30
int
31
main (void)
32
{
33
  int i, j, res = 0;
34
 
35
  for (i = 0; i < N; i++)
36
    for (j = 0; j < N; j++)
37
      {
38
        B[i][j] = j;
39
        C[i][j] = i;
40
      }
41
 
42
  matmult ();
43
 
44
  for (i = 0; i < N; i++)
45
    res += A[i][i];
46
 
47
#if DEBUG
48
  fprintf (stderr, "res = %d \n", res);
49
#endif
50
 
51
  if (res != 529340000)
52
    abort ();
53
 
54
  return 0;
55
}
56
 
57
/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
58
/* { dg-final { cleanup-tree-dump "graphite" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.