blob: 1aace211c844cef82ce9ae314cb236dd4dab53c2 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +00002
3@protocol P0
4-bar;
5@end
6
7@interface A <P0>
8@end
9
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000010// Interface conforms to inherited protocol
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000011
12@interface B0 : A <P0>
13@end
14
15@implementation B0
16@end
17
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000018// Interface conforms to a protocol which extends another. The other
19// protocol is inherited, and extended methods are implemented.
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000020
21@protocol P1 <P0>
22-foo;
23@end
24
25@interface B1 : A <P1>
26@end
27
28@implementation B1
29-foo {};
30@end
31
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000032// Interface conforms to a protocol whose methods are provided by an
33// alternate inherited protocol.
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000034
35@protocol P2
36-bar;
37@end
38
39@interface B2 : A <P2>
40@end
41
42@implementation B2
43@end
44
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000045// Interface conforms to a protocol whose methods are provided by a base class.
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000046
47@interface A1
48-bar;
49@end
50
51@interface B3 : A1 <P2>
52@end
53
54@implementation B3
55@end
56