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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [autopar-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 273 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-ftree-parallelize-loops=4 -O2 -ffast-math" } */
3
 
4
extern void abort (void);
5
 
6
double d[1024], e[1024];
7
int f[1024], g[1024];
8
 
9
double __attribute__((noinline))
10
foo (void)
11
{
12
  double s = 0.0;
13
  int i;
14
  for (i = 0; i < 1024; i++)
15
    s += d[i] - e[i];
16
  return s;
17
}
18
 
19
int __attribute__((noinline))
20
bar (void)
21
{
22
  int s = 0, i;
23
  for (i = 0; i < 1024; i++)
24
    s += f[i] - g[i];
25
  return s;
26
}
27
 
28
int
29
main (void)
30
{
31
  int i;
32
  for (i = 0; i < 1024; i++)
33
    {
34
      d[i] = i * 2;
35
      e[i] = i;
36
      f[i] = i * 2;
37
      g[i] = i;
38
    }
39
  if (foo () != 1023 * 1024 / 2)
40
    abort ();
41
  if (bar () != 1023 * 1024 / 2)
42
    abort ();
43
  return 0;
44
}

powered by: WebSVN 2.1.0

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