[cfe-commits] r76125 - /cfe/trunk/test/SemaObjC/conditional-expr.m

Daniel Dunbar daniel at zuster.org
Thu Jul 16 16:34:22 PDT 2009


Author: ddunbar
Date: Thu Jul 16 18:34:22 2009
New Revision: 76125

URL: http://llvm.org/viewvc/llvm-project?rev=76125&view=rev
Log:
Some more ?: for Obj-C tests.

Modified:
    cfe/trunk/test/SemaObjC/conditional-expr.m

Modified: cfe/trunk/test/SemaObjC/conditional-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/conditional-expr.m?rev=76125&r1=76124&r2=76125&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/conditional-expr.m (original)
+++ cfe/trunk/test/SemaObjC/conditional-expr.m Thu Jul 16 18:34:22 2009
@@ -92,3 +92,30 @@
 void f6(int cond, C *x, D *y) {
   (cond ? x : y).intProp = 1; // expected-warning {{incompatible operand types}}, expected-error {{property 'intProp' not found on object of type 'id'}}
 }
+
+id f7(int a, id<P0> x, A* p) {
+  return a ? x : p;
+}
+
+void f8(int a, A<P0> *x, A *y) {
+  [ (a ? x : y ) intProp ];
+}
+
+void f9(int a, A<P0> *x, A<P1> *y) {
+  id l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')'}}
+  A<P0> *l1 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
+  A<P1> *l2 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
+  [ (a ? x : y ) intProp ]; // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
+}
+
+void f10(int a, id<P0> x, id y) {
+  [ (a ? x : y ) intProp ];
+}
+
+void f11(int a, id<P0> x, id<P1> y) {
+  [ (a ? x : y ) intProp ]; // expected-warning {{incompatible operand types ('id<P0>' and 'id<P1>')}}
+}
+
+void f12(int a, A<P0> *x, A<P1> *y) {
+  A<P1>* l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
+}





More information about the cfe-commits mailing list