Home | History | Annotate | Download | only in Rewriter
      1 // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
      2 // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"SEL=void*" -U__declspec -D"__declspec(X)=" %t-rw.cpp
      3 // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
      4 // RUN: %clang_cc1 -fsyntax-only -Werror -Wno-address-of-temporary -D"SEL=void*" -U__declspec  -D"__declspec(X)=" %t-modern-rw.cpp
      5 // radar 7692350
      6 
      7 // rdar://11375908
      8 typedef unsigned long size_t;
      9 
     10 void f(void (^block)(void));
     11 
     12 @interface X {
     13         int y;
     14 }
     15 - (void)foo;
     16 @end
     17 
     18 @implementation X
     19 - (void)foo {
     20         __block int kerfluffle;
     21         // radar 7692183
     22         __block int x;
     23         f(^{
     24                 f(^{
     25                                 y = 42;
     26                             kerfluffle = 1;
     27 			    x = 2;
     28                 });
     29         });
     30 }
     31 @end
     32