repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
objc
/
execute
/
exceptions
/
finally-1.m
blob
5f32de2b4e17e93cd427d18b220d8cbe29ee5510
1
#include <objc/Object.h>
2
#include <stdio.h>
3
#include <stdlib.h>
4
5
static int made_try = 0;
6
7
int
8
thrower_try_body()
9
{
10
made_try++;
11
return (0);
12
}
13
14
static int made_finally = 0;
15
16
int
17
finally_body()
18
{
19
made_finally++;
20
return (0);
21
}
22
23
int
24
thrower()
25
{
26
@try
27
{
28
thrower_try_body();
29
@throw [Object new];
30
}
31
@finally
32
{
33
finally_body();
34
}
35
return 0;
36
}
37
38
static int made_catch = 0;
39
40
int
41
main(int ac, char *av[])
42
{
43
@try
44
{
45
thrower();
46
}
47
@catch (id exc)
48
{
49
made_catch++;
50
[exc free];
51
}
52
if (made_try != 1)
53
abort ();
54
if (made_finally != 1)
55
abort ();
56
if (made_catch != 1)
57
abort ();
58
return 0;
59
}