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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [block-5.c] - Blame information for rev 338

Details | Compare with Previous | View Log

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