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] - Rev 437

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

#include <stdio.h>
 
void sub0(void);
void c_sub0(void (*sub)(void));
void c_sub1(int (*func)(int));
 
extern void abort(void);
 
int main(int argc, char **argv)
{
  printf("hello from C main\n");
 
  sub0();
  return 0;
}
 
void c_sub0(void (*sub)(void))
{
  printf("hello from c_sub0\n");
  sub();
 
  return;
}
 
void c_sub1(int (*func)(int))
{
  int retval;
 
  printf("hello from c_sub1\n");
 
  retval = func(10);
  if(retval != 10)
  {
    fprintf(stderr, "Fortran function did not return expected value!\n");
    abort();
  }
 
  return;
}
 

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

powered by: WebSVN 2.1.0

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