repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
setjmp-3.c
blob
306861d25c3aecd0e0d28d02f5908667f5e21fce
1
/* { dg-do run } */
2
/* { dg-options "-O" } */
3
4
#include <setjmp.h>
5
6
extern
void
abort
(
void
);
7
8
jmp_buf
buf
;
9
10
void
raise0
(
void
)
11
{
12
__builtin_longjmp
(
buf
,
1
);
13
}
14
15
int
execute
(
int
cmd
)
16
{
17
int
last
=
0
;
18
19
if
(
__builtin_setjmp
(
buf
) ==
0
)
20
while
(
1
)
21
{
22
last
=
1
;
23
raise0
();
24
}
25
26
if
(
last
==
0
)
27
return
0
;
28
else
29
return
cmd
;
30
}
31
32
int
main
(
void
)
33
{
34
if
(
execute
(
1
) ==
0
)
35
abort
();
36
37
return
0
;
38
}