blob: 7160b16c447e3727f245e26404ea7f9fe315cb43 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -emit-llvm -o %t %s
Daniel Dunbarb21d6af2008-09-04 04:36:23 +00002
Daniel Dunbar23afaad2009-11-17 08:57:36 +00003int printf(const char *, ...);
Daniel Dunbarb21d6af2008-09-04 04:36:23 +00004
5@interface Root
6-(id) alloc;
7-(id) init;
8@end
9
10@interface A : Root {
11 int x;
Fariborz Jahanianae6f6fd2008-12-05 22:32:48 +000012 int y, ro, z;
Daniel Dunbar739a36b2008-09-24 18:00:13 +000013 id ob0, ob1, ob2, ob3, ob4;
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000014}
15@property int x;
16@property int y;
17@property int z;
18@property(readonly) int ro;
Daniel Dunbar739a36b2008-09-24 18:00:13 +000019@property(assign) id ob0;
20@property(retain) id ob1;
21@property(copy) id ob2;
22@property(retain, nonatomic) id ob3;
23@property(copy, nonatomic) id ob4;
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000024@end
25
26@implementation A
27@dynamic x;
Fariborz Jahanianae6f6fd2008-12-05 22:32:48 +000028@synthesize y;
29@synthesize z = z;
30@synthesize ro;
Daniel Dunbar739a36b2008-09-24 18:00:13 +000031@synthesize ob0;
32@synthesize ob1;
33@synthesize ob2;
34@synthesize ob3;
35@synthesize ob4;
Daniel Dunbarb21d6af2008-09-04 04:36:23 +000036-(int) y {
37 return x + 1;
38}
39-(void) setZ: (int) arg {
40 x = arg - 1;
41}
42@end
43
44@interface A (Cat)
45@property int dyn;
46@end
47
48@implementation A (Cat)
49-(int) dyn {
50 return 10;
51}
52@end