Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 2 | |
| 3 | @protocol P0 |
| 4 | -bar; |
| 5 | @end |
| 6 | |
| 7 | @interface A <P0> |
| 8 | @end |
| 9 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 10 | // Interface conforms to inherited protocol |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 11 | |
| 12 | @interface B0 : A <P0> |
| 13 | @end |
| 14 | |
| 15 | @implementation B0 |
| 16 | @end |
| 17 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 18 | // Interface conforms to a protocol which extends another. The other |
| 19 | // protocol is inherited, and extended methods are implemented. |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 20 | |
| 21 | @protocol P1 <P0> |
| 22 | -foo; |
| 23 | @end |
| 24 | |
| 25 | @interface B1 : A <P1> |
| 26 | @end |
| 27 | |
| 28 | @implementation B1 |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 29 | -foo { return 0; }; |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 30 | @end |
| 31 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 32 | // Interface conforms to a protocol whose methods are provided by an |
| 33 | // alternate inherited protocol. |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 34 | |
| 35 | @protocol P2 |
| 36 | -bar; |
| 37 | @end |
| 38 | |
| 39 | @interface B2 : A <P2> |
| 40 | @end |
| 41 | |
| 42 | @implementation B2 |
| 43 | @end |
| 44 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 45 | // Interface conforms to a protocol whose methods are provided by a base class. |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 46 | |
| 47 | @interface A1 |
| 48 | -bar; |
| 49 | @end |
| 50 | |
| 51 | @interface B3 : A1 <P2> |
| 52 | @end |
| 53 | |
| 54 | @implementation B3 |
| 55 | @end |
| 56 | |