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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [c_funloc_tests_4_driver.c] - Rev 801

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.