]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Rewriter/rewrite-byref-vars.mm
Update clang to r93512.
[FreeBSD/FreeBSD.git] / test / Rewriter / rewrite-byref-vars.mm
1 // RUN: %clang_cc1 -fms-extensions -rewrite-objc -x objective-c++ -fblocks -o - %s
2 // radar 7540194
3
4 extern "C" __declspec(dllexport) void BreakTheRewriter(int i) {
5         __block int aBlockVariable = 0;
6         void (^aBlock)(void) = ^ {
7                 aBlockVariable = 42;
8         };
9         aBlockVariable++;
10         if (i) {
11           __block int bbBlockVariable = 0;
12           void (^aBlock)(void) = ^ {
13                 bbBlockVariable = 42;
14           };
15         }
16 }
17
18 __declspec(dllexport) extern "C" __declspec(dllexport) void XXXXBreakTheRewriter(void) {
19
20         __block int aBlockVariable = 0;
21         void (^aBlock)(void) = ^ {
22                 aBlockVariable = 42;
23         };
24         aBlockVariable++;
25         void (^bBlocks)(void) = ^ {
26                 aBlockVariable = 43;
27         };
28         void (^c)(void) = ^ {
29                 aBlockVariable = 44;
30         };
31
32 }
33
34 // $CLANG -cc1 -fms-extensions -rewrite-objc -x objective-c++ -fblocks bug.mm
35 // g++ -c -D"__declspec(X)=" bug.cpp