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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [run-id-2.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
int a[1] = {1};
2
 
3
static int __attribute__((noinline))
4
foo(int n)
5
{
6
  int i, c = 0;
7
  for (i = 0; i < n; i++)
8
    c += a[i];
9
  return c;
10
}
11
 
12
int b[2] = {2, 3};
13
 
14
static int __attribute__((noinline)) bar(int n)
15
{
16
  int i, c = 0;
17
  for (i = 0; i < n; i++)
18
    c += b[i];
19
  return c;
20
}
21
 
22
extern void abort ();
23
 
24
int main()
25
{
26
  if (foo(0) != 0
27
      || foo(1) != 1
28
      || bar(0) != 0
29
      || bar(1) != 2
30
      || bar(2) != 5)
31
    abort ();
32
 
33
  return 0;
34
}
35
 

powered by: WebSVN 2.1.0

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