[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaObjC / comptypes-10.m
blob5f16a6e654f15a17df4964948116eef924ab769e
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %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>'}}
36 // rdar://8843851
37 @interface NSObject (CAT)
38 + (struct S*)Meth : (struct S*)arg;
39 @end
41 struct S {
42  char *types;
45 @interface I
46 @end
48 @implementation I
49 - (struct S *)Meth : (struct S*)a {
50   return [NSObject Meth : a];
52 @end