89 lines · plain
1//-*- ObjC -*-2 3@protocol P0;4 5@protocol P1 6-(void) fm0;7@end8 9@class B;10 11@interface Root12@property(readonly) int p0;13@end14 15@interface A : Root <P1> {16 int iv0;17 B *iv1;18 B<P1> *iv2;19}20 21@property(readonly) int p0;22@property(assign,nonatomic,readwrite) int p1;23@property(copy) id p2;24@property(retain) id p3;25@property(assign, getter=getme, setter=setme:) id p4;26@property(assign, readwrite) id p5;27@end28 29@implementation A30@dynamic p0;31@synthesize p1 = iv0;32 33// Property type can differ from ivar type.34@synthesize p5 = iv2;35 36+(void) fm0 {37 [super fm0];38}39-(void) im0 {40 const char *s0 = __func__;41 const char *s1 = __FUNCTION__;42 const char *s2 = __PRETTY_FUNCTION__;43 [super im0];44 int x = super.p0;45}46-(void) im1: (int) x, ... {47}48@end49 50@implementation C : A51@end52 53@interface A (Cat)54@end55 56@implementation A (Cat)57@end58 59@interface B60@end61 62int f0(id x) {63 @synchronized(x) {64 }65 66 @try {67 @throw x;68 69 } @catch(A *e) {70 @throw;71 72 // @catch param doesn't require name.73 } @catch(B *) {74 75 } @finally {76 ;77 }78 79 for (id y in x) {80 break;81 }82}83 84#ifndef __OBJC2__85struct s0 {86 @defs(A);87};88#endif89