Debian Codegraph @

clang/test/Rewriter/rewrite-byref-in-nested-blocks.mm

raw
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 -std=gnu++98 -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 -std=gnu++98 -Werror -Wno-address-of-temporary -D"SEL=void*" -U__declspec -D"__declspec(X)=" %t-modern-rw.cpp
5
6 typedef unsigned long size_t;
7
8 void f(void (^block)(void));
9
10 @interface X {
11 int y;
12 }
13 - (void)foo;
14 @end
15
16 @implementation X
17 - (void)foo {
18 __block int kerfluffle;
19 __block int x;
20 f(^{
21 f(^{
22 y = 42;
23 kerfluffle = 1;
24 x = 2;
25 });
26 });
27 }
28 @end