blob: ae5d9273fdfb8561f67795c9c59881bfb0b8167d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/* Check that throwing an exception from a -forward:: works. */
/* Developed by Marcin Koziej <creep@desk.pl>. */
#include <stdlib.h>
#import "../../../objc-obj-c++-shared/Object1.h"
#import <objc/objc-api.h>
static int i;
@interface Thrower : Object
- forward: (SEL) s : (void*) a;
@end
@implementation Thrower
- forward: (SEL) s : (void*) a
{
i++;
@throw [Object new];
}
@end
int
main()
{
id t = [Thrower new];
@try
{
[t doesnotexist];
}
@catch (id error)
{
i++;
[error free];
}
if (i != 2)
abort ();
return 0;
}
|