repo.or.cz
/
binutils-gdb.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Update release-README after completing the 2.43 release.
[binutils-gdb.git]
/
sim
/
testsuite
/
cris
/
c
/
sjlj.c
blob
141faf6e612b397410e776dbebf4736b17415900
1
/* 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
}