[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaObjC / comptypes-5.m
blob46300e3a5309e8795160ae1218125105aefe428c
1 // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
3 #define nil (void *)0;
5 extern void foo();
7 @protocol MyProtocol
8 - (void) method;
9 @end
11 @interface MyClass
12 @end
14 @interface MyClass (Addition) <MyProtocol>
15 - (void) method;
16 @end
18 @interface MyOtherClass : MyClass
19 @end
21 int main()
23   id <MyProtocol> obj_id_p = nil;
24   MyClass *obj_c_cat_p = nil;
25   MyOtherClass *obj_c_super_p = nil;
26   MyOtherClass<MyProtocol> *obj_c_super_p_q = nil;
27   MyClass<MyProtocol> *obj_c_cat_p_q = nil;
29   obj_c_cat_p = obj_id_p;
30   obj_c_super_p = obj_id_p;
31   obj_id_p = obj_c_cat_p;  /* Ok */
32   obj_id_p = obj_c_super_p; /* Ok */
34   if (obj_c_cat_p == obj_id_p) foo(); /* Ok */
35   if (obj_c_super_p == obj_id_p) foo() ; /* Ok */
36   if (obj_id_p == obj_c_cat_p)  foo(); /* Ok */
37   if (obj_id_p == obj_c_super_p)  foo(); /* Ok */
39   obj_c_cat_p = obj_c_super_p; // ok.
40   obj_c_cat_p = obj_c_super_p_q; // ok.
41   obj_c_super_p = obj_c_cat_p_q; // expected-warning {{incompatible pointer types}}
42   obj_c_cat_p_q = obj_c_super_p;
43   return 0;