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/] [interchange-6.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
/* Formerly known as ltrans-6.c */
4
 
5
#define DEBUG 0
6
#if DEBUG
7
#include <stdio.h>
8
#endif
9
 
10
#define N 100
11
#define M 200
12
 
13
static int __attribute__((noinline))
14
foo (int A[N][M])
15
{
16
  int i, j;
17
 
18
  /* This loop should be interchanged. */
19
  for(j = 0; j < M; j++)
20
    for(i = 0; i < N; i++)
21
      A[i][j] = A[i][j] + A[i][j];
22
 
23
  return A[0][0] + A[N-1][M-1];
24
}
25
 
26
extern void abort ();
27
 
28
int
29
main (void)
30
{
31
  int A[N][M];
32
  int i, j, res;
33
 
34
  for (i = 0; i < N; i++)
35
    for (j = 0; j < M; j++)
36
      A[i][j] = 2;
37
 
38
  res = foo (A);
39
 
40
#if DEBUG
41
  fprintf (stderr, "res = %d \n", res);
42
#endif
43
 
44
  if (res != 8)
45
    abort ();
46
 
47
  return 0;
48
}
49
 
50
/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
51
/* { 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.