Fariborz Jahanian | 43aa1c3 | 2012-04-16 22:14:01 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -E %s -o %t.mm |
John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %t.mm -o %t-rw.cpp |
Fariborz Jahanian | 2663f52 | 2010-02-04 00:07:58 +0000 | [diff] [blame] | 3 | // RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s |
Fariborz Jahanian | 43aa1c3 | 2012-04-16 22:14:01 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-modern-rw.cpp |
| 5 | // RUN: FileCheck -check-prefix LP --input-file=%t-modern-rw.cpp %s |
Fariborz Jahanian | 2663f52 | 2010-02-04 00:07:58 +0000 | [diff] [blame] | 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 | |
Fariborz Jahanian | 43aa1c3 | 2012-04-16 22:14:01 +0000 | [diff] [blame] | 26 | // CHECK-LP: (__Block_byref_q_0 *)&q |