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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [interchange-15.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
 
3
#define DEBUG 0
4
#if DEBUG
5
#include <stdio.h>
6
#endif
7
 
8
#define NMAX 2000
9
 
10
static int x[NMAX], a[NMAX][NMAX];
11
 
12
static int __attribute__((noinline))
13
mvt (long N)
14
{
15
  int i,j;
16
 
17
  /* These two loops should be interchanged.  */
18
  for (i = 0; i < N; i++)
19
    for (j = 0; j < N; j++)
20
      x[i] += a[j][i];
21
 
22
  return x[1];
23
}
24
 
25
extern void abort ();
26
 
27
int
28
main (void)
29
{
30
  int i, j, res;
31
 
32
  for (i = 0; i < NMAX; i++)
33
    for (j = 0; j < NMAX; j++)
34
      a[i][j] = j;
35
 
36
  for (i = 0; i < NMAX; i++)
37
    x[i] = i;
38
 
39
  res = mvt (NMAX);
40
 
41
#if DEBUG
42
  fprintf (stderr, "res = %d \n", res);
43
#endif
44
 
45
  if (res != 2001)
46
    abort ();
47
 
48
  return 0;
49
}
50
 
51
/* PRE destroys the perfect nest and we can't cope with that yet.  */
52
/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
53
/* { dg-final { cleanup-tree-dump "graphite" } } */
54
 

powered by: WebSVN 2.1.0

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