URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [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); }