blob: 807d4dae36b5ab82664be126d165558af6fd80e8 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbsc6e68da2012-10-19 12:44:48 +00002// expected-no-diagnostics
Steve Naroffed031702009-03-08 18:56:13 +00003
4@interface NSObject {}
5
6@end
7
8@interface MyClass : NSObject {}
9
10@end
11
12@interface MyClass (MyCategorie)
13
14@end
15
16@interface MySubClass : MyClass {}
17
18@end
19
20@interface MySubSubClass : MySubClass {}
21
22@end
23
24@implementation NSObject (NSObjectCategory)
25- (void)rootMethod {}
26@end
27
28@implementation MyClass
29
30+ (void)myClassMethod { }
31- (void)myMethod { }
32
33@end
34
35@implementation MyClass (MyCategorie)
36+ (void)myClassCategoryMethod { }
37- (void)categoryMethod {}
38@end
39
40@implementation MySubClass
41
42- (void)mySubMethod {}
43
44- (void)myTest {
45 [self mySubMethod];
46 // should lookup method in superclass implementation if available
47 [self myMethod];
48 [super myMethod];
49
50 [self categoryMethod];
51 [super categoryMethod];
52
53 // instance method of root class
54 [MyClass rootMethod];
55
56 [MyClass myClassMethod];
57 [MySubClass myClassMethod];
58
59 [MyClass myClassCategoryMethod];
60 [MySubClass myClassCategoryMethod];
61}
62
63@end