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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [cris/] [c/] [sjlj.c] - Rev 227

Compare with Previous | Blame | View Log

/* Check that setjmp and longjmp stand a chance to work; that the used machine
   primitives work in the simulator.  */
 
#include <stdio.h>
#include <setjmp.h>
#include <stdlib.h>
 
extern void f (void);
 
int ok = 0;
jmp_buf b;
 
int
main ()
{
  int ret = setjmp (b);
 
  if (ret == 42)
    ok = 100;
  else if (ret == 0)
    f ();
 
  if (ok == 100)
    printf ("pass\n");
  else
    printf ("fail\n");
  exit (0);
}
 
void
f (void)
{
  longjmp (b, 42);
}
 

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.