Sign in
third-party-mirror
/
mingw-w64
/
23275a7d2df57ab21c3a0e12112e2c5c7e6a76de
/
.
/
mingw-w64-crt
/
testcases
/
t_setjmp.c
blob: d626b73107114530f29aa6df0fc67c8d0623c828 [
file
] [
log
] [
blame
]
#include
<stdio.h>
#include
<setjmp.h>
jmp_buf buf
;
void
foo
(
void
)
{
printf
(
"Call longjmp\n"
);
longjmp
(
buf
,
1
);
}
int
main
()
{
if
(
setjmp
(
buf
))
{
printf
(
"Caught\n"
);
}
else
{
foo
();
printf
(
"Should not be reached.\n"
);
return
1
;
}
return
0
;
}