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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [sim/] [testsuite/] [sim/] [cris/] [c/] [sjlj.c] - Blame information for rev 330

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
/* Check that setjmp and longjmp stand a chance to work; that the used machine
2
   primitives work in the simulator.  */
3
 
4
#include <stdio.h>
5
#include <setjmp.h>
6
#include <stdlib.h>
7
 
8
extern void f (void);
9
 
10
int ok = 0;
11
jmp_buf b;
12
 
13
int
14
main ()
15
{
16
  int ret = setjmp (b);
17
 
18
  if (ret == 42)
19
    ok = 100;
20
  else if (ret == 0)
21
    f ();
22
 
23
  if (ok == 100)
24
    printf ("pass\n");
25
  else
26
    printf ("fail\n");
27
  exit (0);
28
}
29
 
30
void
31
f (void)
32
{
33
  longjmp (b, 42);
34
}

powered by: WebSVN 2.1.0

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