]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Rewriter/blockcast3.mm
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / Rewriter / blockcast3.mm
1 // RUN: %clang_cc1 -E %s -o %t.mm
2 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %t.mm -o %t-rw.cpp
3 // RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
4 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-modern-rw.cpp
5 // RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-modern-rw.cpp %s
6 // radar 7607781
7
8 typedef struct {
9         int a;
10         int b;
11 } mystruct;
12         
13 void g(int (^block)(mystruct s)) {
14         mystruct x;
15         int v = block(x);
16 }
17
18 void f(const void **arg) {
19         __block const void **q = arg;
20         g(^(mystruct s){
21                 *q++ = (void*)s.a;
22                 return 314;
23                 });
24 }
25
26 // CHECK-LP: (__Block_byref_q_0 *)&q