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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [interchange-13.c] - Blame information for rev 749

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