xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-function-decl.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 -x objective-c++ -fblocks -o - %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambucextern "C" __declspec(dllexport) void BreakTheRewriter(void) {
4*f4a2713aSLionel Sambuc        __block int aBlockVariable = 0;
5*f4a2713aSLionel Sambuc        void (^aBlock)(void) = ^ {
6*f4a2713aSLionel Sambuc                aBlockVariable = 42;
7*f4a2713aSLionel Sambuc        };
8*f4a2713aSLionel Sambuc        aBlockVariable++;
9*f4a2713aSLionel Sambuc        void (^bBlocks)(void) = ^ {
10*f4a2713aSLionel Sambuc                aBlockVariable = 43;
11*f4a2713aSLionel Sambuc        };
12*f4a2713aSLionel Sambuc        void (^c)(void) = ^ {
13*f4a2713aSLionel Sambuc                aBlockVariable = 44;
14*f4a2713aSLionel Sambuc        };
15*f4a2713aSLionel Sambuc
16*f4a2713aSLionel Sambuc}
17*f4a2713aSLionel Sambuc__declspec(dllexport) extern "C" void AnotherBreakTheRewriter(int *p1, double d) {
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc        __block int bBlockVariable = 0;
20*f4a2713aSLionel Sambuc        void (^aBlock)(void) = ^ {
21*f4a2713aSLionel Sambuc                bBlockVariable = 42;
22*f4a2713aSLionel Sambuc        };
23*f4a2713aSLionel Sambuc        bBlockVariable++;
24*f4a2713aSLionel Sambuc        void (^bBlocks)(void) = ^ {
25*f4a2713aSLionel Sambuc                bBlockVariable = 43;
26*f4a2713aSLionel Sambuc        };
27*f4a2713aSLionel Sambuc        void (^c)(void) = ^ {
28*f4a2713aSLionel Sambuc                bBlockVariable = 44;
29*f4a2713aSLionel Sambuc        };
30*f4a2713aSLionel Sambuc
31*f4a2713aSLionel Sambuc}
32