blob: 3b092ffbf4cf611db6bb2a097d488dcfbc3ffc5e [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 Dunbar8de8c362008-10-24 08:39:46 +000037#ifndef IRGENABLE
Daniel Dunbar63c3a5f2008-10-17 23:04:32 +000038 int x = super.p0;
Daniel Dunbar8de8c362008-10-24 08:39:46 +000039#endif
Daniel Dunbar417dd172008-10-04 23:47:28 +000040}
41-(void) im1: (int) x, ... {
42}
43@end
44
45@implementation C : A
46@end
47
Daniel Dunbar417dd172008-10-04 23:47:28 +000048@interface A (Cat)
49@end
50
51@implementation A (Cat)
52@end
Daniel Dunbar417dd172008-10-04 23:47:28 +000053
Daniel Dunbarfe345572009-03-05 22:59:19 +000054@interface B
55@end
56
Daniel Dunbar417dd172008-10-04 23:47:28 +000057int f0(id x) {
Daniel Dunbarb451bc12008-10-24 08:42:52 +000058#ifndef IRGENABLE_GNU
Daniel Dunbar8de8c362008-10-24 08:39:46 +000059#ifndef IRGENABLE
Daniel Dunbar417dd172008-10-04 23:47:28 +000060 @synchronized(x) {
61 }
Daniel Dunbar8de8c362008-10-24 08:39:46 +000062#endif
Daniel Dunbarb451bc12008-10-24 08:42:52 +000063#endif
Daniel Dunbar417dd172008-10-04 23:47:28 +000064
Daniel Dunbarb451bc12008-10-24 08:42:52 +000065#ifndef IRGENABLE_GNU
Daniel Dunbar417dd172008-10-04 23:47:28 +000066 @try {
67 @throw x;
Daniel Dunbarfe345572009-03-05 22:59:19 +000068
Daniel Dunbar417dd172008-10-04 23:47:28 +000069 } @catch(A *e) {
70 @throw;
Daniel Dunbarfe345572009-03-05 22:59:19 +000071
72 // @catch param doesn't require name.
73 } @catch(B *) {
74
Daniel Dunbar417dd172008-10-04 23:47:28 +000075 } @finally {
76 ;
77 }
78
79 for (id y in x) {
80 break;
81 }
Daniel Dunbarb451bc12008-10-24 08:42:52 +000082#endif
Daniel Dunbar417dd172008-10-04 23:47:28 +000083}
84
85struct s0 {
86 @defs(A);
87};