| 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 |
|
| 7 |
typedef struct { |
| 8 |
int a; |
| 9 |
int b; |
| 10 |
} mystruct; |
| 11 |
|
| 12 |
void g(int (^block)(mystruct s)) { |
| 13 |
mystruct x; |
| 14 |
int v = block(x); |
| 15 |
} |
| 16 |
|
| 17 |
void f(const void **arg) { |
| 18 |
__block const void **q = arg; |
| 19 |
g(^(mystruct s){ |
| 20 |
*q++ = (void*)s.a; |
| 21 |
return 314; |
| 22 |
}); |
| 23 |
} |
| 24 |
|
| 25 |
// CHECK-LP: (__Block_byref_q_0 *)&q |