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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [pr46185.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-do run } */
2
/* { dg-options "-O2 -floop-interchange -ffast-math -fno-ipa-cp" } */
3
 
4
#define DEBUG 0
5
#if DEBUG
6
#include <stdio.h>
7
#endif
8
 
9
double u[1782225];
10
 
11
static int __attribute__((noinline))
12
foo (int N, int *res)
13
{
14
  int i, j;
15
  double sum = 0;
16
  for (i = 0; i < N; i++)
17
    for (j = 0; j < N; j++)
18
      sum = sum + u[i + 1335 * j];
19
 
20
  for (i = 0; i < N; i++)
21
    u[1336 * i] *= 2;
22
 
23
  *res = sum + N + u[1336 * 2] + u[1336];
24
}
25
 
26
extern void abort ();
27
 
28
int
29
main (void)
30
{
31
  int i, j, res;
32
 
33
  for (i = 0; i < 1782225; i++)
34
    u[i] = 2;
35
 
36
  foo (1335, &res);
37
 
38
#if DEBUG
39
  fprintf (stderr, "res = %d \n", res);
40
#endif
41
 
42
  if (res != 3565793)
43
    abort ();
44
 
45
  return 0;
46
}

powered by: WebSVN 2.1.0

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