[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Rewriter / rewrite-byref-in-nested-blocks.mm
blobfce5890ad4ea589d8f189dde9e22c9557d173dcc
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 // radar 7692350
7 // rdar://11375908
8 typedef unsigned long size_t;
10 void f(void (^block)(void));
12 @interface X {
13         int y;
15 - (void)foo;
16 @end
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         });
31 @end