clang/test/Rewriter/blockstruct.m
raw| 1 | // RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp |
| 2 | // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp |
| 3 | |
| 4 | typedef void (^b_t)(void); |
| 5 | void a(b_t work) { } |
| 6 | struct _s { |
| 7 | int a; |
| 8 | }; |
| 9 | struct _s *r(void); |
| 10 | |
| 11 | void f(void) { |
| 12 | __block struct _s *s = 0; |
| 13 | a(^{ |
| 14 | s = (struct _s *)r(); |
| 15 | }); |
| 16 | } |