blob: c333bb5042d29c6d8cce909d362a6494e192fcc4 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -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
Mike Stumpd1969d82009-07-22 00:43:08 +000029-foo { return 0; };
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000030@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