Add an assert for safety check.
[clang.git] / test / SemaObjC / method-lookup-3.m
blob8ed583faebc772d3c100511be09d03cd8b5740d8
1 // RUN: clang-cc -fsyntax-only -verify %s
3 typedef struct { int y; } Abstract;
5 typedef struct { int x; } Alternate;
7 #define INTERFERE_TYPE Alternate*
9 @protocol A
10 @property Abstract *x; // expected-note {{using}}
11 @end
13 @interface B
14 @property Abstract *y; // expected-note {{using}}
15 @end
17 @interface B (Category)
18 @property Abstract *z; // expected-note {{using}}
19 @end
21 @interface InterferencePre
22 -(void) x; // expected-note {{also found}}
23 -(void) y; // expected-note {{also found}}
24 -(void) z; // expected-note {{also found}}
25 -(void) setX: (INTERFERE_TYPE) arg; 
26 -(void) setY: (INTERFERE_TYPE) arg;
27 -(void) setZ: (INTERFERE_TYPE) arg;
28 @end
30 void f0(id a0) {
31   Abstract *l = [a0 x]; // expected-warning {{multiple methods named 'x' found}} 
34 void f1(id a0) {
35   Abstract *l = [a0 y]; // expected-warning {{multiple methods named 'y' found}}
38 void f2(id a0) {
39   Abstract *l = [a0 z]; // expected-warning {{multiple methods named 'z' found}}
42 void f3(id a0, Abstract *a1) { 
43   [ a0 setX: a1];
46 void f4(id a0, Abstract *a1) { 
47   [ a0 setY: a1];
50 void f5(id a0, Abstract *a1) { 
51   [ a0 setZ: a1];