[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / SemaObjC / comptypes-10.m
blob0a2219099fb603168bd1e6323035fcf1d3791bf5
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 //rdar: //8591619
3 // pr8453
5 @protocol NSCopying @end
6 @protocol NSPROTO @end
7 @protocol NSPROTO1 @end
8 @protocol NSPROTO2 @end
10 @interface NSObject <NSCopying, NSPROTO, NSPROTO1> {
11     Class isa;
13 @end
15 void gorf(NSObject <NSCopying> *); // expected-note {{passing argument to parameter here}}
17 NSObject <NSCopying> *foo(id <NSCopying> bar, id id_obj)
19         NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying>'}}
20         NSObject *Init1 = bar; // expected-warning {{initializing 'NSObject *' with an expression of incompatible type 'id<NSCopying>'}}
22         NSObject <NSCopying> *I = id_obj; 
23         NSObject *I1 = id_obj; 
24         gorf(bar);      // expected-warning {{passing 'id<NSCopying>' to parameter of incompatible type 'NSObject<NSCopying> *'}}
26         gorf(id_obj);   
28         return bar;     // expected-warning {{returning 'id<NSCopying>' from a function with incompatible result type 'NSObject<NSCopying> *'}} 
31 void test(id <NSCopying, NSPROTO, NSPROTO2> bar)
33   NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying,NSPROTO,NSPROTO2>'}}