Home | History | Annotate | Download | only in Rewriter
      1 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
      2 // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
      3 // rdar://11359268
      4 
      5 extern "C" void *sel_registerName(const char *);
      6 typedef unsigned long size_t;
      7 
      8 union U {
      9   double d1;
     10   char filler[32];
     11 };
     12 
     13 struct S {
     14   char filler[128];
     15 };
     16 
     17 @interface I
     18 - (struct S) Meth : (int) arg1 : (id) arg2;
     19 - (struct S) Meth1;
     20 - (union U) Meth2 : (double)d;
     21 - (struct S) VAMeth : (int)anchor, ...;
     22 @end
     23 
     24 I* PI();
     25 
     26 extern "C" {
     27 
     28 struct S foo () {
     29   struct S s = [PI() Meth : 1 : (id)0];
     30 
     31   U u = [PI() Meth2 : 3.14];
     32 
     33   S s1 = [PI() VAMeth : 12, 13.4, 1000, "hello"];
     34 
     35   S s2 = [PI() VAMeth : 12];
     36 
     37   S s3 = [PI() VAMeth : 0, "hello", "there"];
     38 
     39   S s4 = [PI() VAMeth : 2, ^{}, &foo];
     40 
     41   return [PI() Meth1];
     42 }
     43 
     44 }
     45 
     46