blob: 45010d5e2e75523064accd8c370f9e804cedc256 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +00003
4@protocol P0
5-bar;
6@end
7
8@interface A <P0>
9@end
10
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000011// Interface conforms to inherited protocol
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000012
13@interface B0 : A <P0>
14@end
15
16@implementation B0
17@end
18
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000019// Interface conforms to a protocol which extends another. The other
20// protocol is inherited, and extended methods are implemented.
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000021
22@protocol P1 <P0>
23-foo;
24@end
25
26@interface B1 : A <P1>
27@end
28
29@implementation B1
Mike Stumpd1969d82009-07-22 00:43:08 +000030-foo { return 0; };
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000031@end
32
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000033// Interface conforms to a protocol whose methods are provided by an
34// alternate inherited protocol.
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000035
36@protocol P2
37-bar;
38@end
39
40@interface B2 : A <P2>
41@end
42
43@implementation B2
44@end
45
Daniel Dunbarab49c0b2008-09-04 21:54:53 +000046// Interface conforms to a protocol whose methods are provided by a base class.
Daniel Dunbar7ad1b1f2008-09-04 20:01:15 +000047
48@interface A1
49-bar;
50@end
51
52@interface B3 : A1 <P2>
53@end
54
55@implementation B3
56@end
57