OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [c_funloc_tests_4_driver.c] - Blame information for rev 437

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
#include <stdio.h>
2
 
3
void sub0(void);
4
void c_sub0(void (*sub)(void));
5
void c_sub1(int (*func)(int));
6
 
7
extern void abort(void);
8
 
9
int main(int argc, char **argv)
10
{
11
  printf("hello from C main\n");
12
 
13
  sub0();
14
  return 0;
15
}
16
 
17
void c_sub0(void (*sub)(void))
18
{
19
  printf("hello from c_sub0\n");
20
  sub();
21
 
22
  return;
23
}
24
 
25
void c_sub1(int (*func)(int))
26
{
27
  int retval;
28
 
29
  printf("hello from c_sub1\n");
30
 
31
  retval = func(10);
32
  if(retval != 10)
33
  {
34
    fprintf(stderr, "Fortran function did not return expected value!\n");
35
    abort();
36
  }
37
 
38
  return;
39
}

powered by: WebSVN 2.1.0

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