blob: dd57dfbedd03798bd22a457e973b0319b3f25b7f [file] [log] [blame]
Daniel Dunbar417dd172008-10-04 23:47:28 +00001//-*- ObjC -*-
2
3@protocol P0;
4
5@protocol P1
6-(void) fm0;
7@end
8
9@class B;
10
11@interface Root
12@end
13
14@interface A : Root <P1> {
15 int iv0;
16 B *iv1;
17}
18
Fariborz Jahanian567c8df2008-12-06 01:12:43 +000019@property(readonly) int p0;
Daniel Dunbar417dd172008-10-04 23:47:28 +000020@property(assign,nonatomic,readwrite) int p1;
21@property(copy) id p2;
22@property(retain) id p3;
23@property(assign, getter=getme, setter=setme:) id p4;
24@end
25
26@implementation A
27@dynamic p0;
28@synthesize p1 = iv0;
29+(void) fm0 {
30 [super fm0];
31}
32-(void) im0 {
Daniel Dunbar8de8c362008-10-24 08:39:46 +000033 const char *s0 = __func__;
34 const char *s1 = __FUNCTION__;
35 const char *s2 = __PRETTY_FUNCTION__;
Daniel Dunbar417dd172008-10-04 23:47:28 +000036 [super im0];
Daniel Dunbar63c3a5f2008-10-17 23:04:32 +000037 int x = super.p0;
Daniel Dunbar417dd172008-10-04 23:47:28 +000038}
39-(void) im1: (int) x, ... {
40}
41@end
42
43@implementation C : A
44@end
45
Daniel Dunbar417dd172008-10-04 23:47:28 +000046@interface A (Cat)
47@end
48
49@implementation A (Cat)
50@end
Daniel Dunbar417dd172008-10-04 23:47:28 +000051
Daniel Dunbarfe345572009-03-05 22:59:19 +000052@interface B
53@end
54
Daniel Dunbar417dd172008-10-04 23:47:28 +000055int f0(id x) {
56 @synchronized(x) {
57 }
Daniel Dunbar417dd172008-10-04 23:47:28 +000058
59 @try {
60 @throw x;
Daniel Dunbarfe345572009-03-05 22:59:19 +000061
Daniel Dunbar417dd172008-10-04 23:47:28 +000062 } @catch(A *e) {
63 @throw;
Daniel Dunbarfe345572009-03-05 22:59:19 +000064
65 // @catch param doesn't require name.
66 } @catch(B *) {
67
Daniel Dunbar417dd172008-10-04 23:47:28 +000068 } @finally {
69 ;
70 }
71
72 for (id y in x) {
73 break;
74 }
Daniel Dunbar417dd172008-10-04 23:47:28 +000075}
76
Daniel Dunbarbd5e5a52009-04-21 21:16:23 +000077#ifndef __OBJC2__
Daniel Dunbar417dd172008-10-04 23:47:28 +000078struct s0 {
79 @defs(A);
80};
Daniel Dunbarbd5e5a52009-04-21 21:16:23 +000081#endif