diff options
Diffstat (limited to 'test/Rewriter/rewrite-block-pointer.mm')
-rw-r--r-- | test/Rewriter/rewrite-block-pointer.mm | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/test/Rewriter/rewrite-block-pointer.mm b/test/Rewriter/rewrite-block-pointer.mm index b03b7a9..212b236 100644 --- a/test/Rewriter/rewrite-block-pointer.mm +++ b/test/Rewriter/rewrite-block-pointer.mm @@ -1,7 +1,10 @@ // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp -// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s +// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp // radar 7638400 +typedef void * id; +void *sel_registerName(const char *); + @interface X @end @@ -13,4 +16,45 @@ static void enumerateIt(void (^block)(id, id, char *)) { } @end -// CHECK-LP: static void enumerateIt(void (*)(id, id, char *)); +// radar 7651312 +void apply(void (^block)(int)); + +static void x(int (^cmp)(int, int)) { + x(cmp); +} + +static void y(int (^cmp)(int, int)) { + apply(^(int sect) { + x(cmp); + }); +} + +// radar 7659483 +void *_Block_copy(const void *aBlock); +void x(void (^block)(void)) { + block = ((__typeof(block))_Block_copy((const void *)(block))); +} + +// radar 7682763 +@interface Y { +@private + id _private; +} +- (void (^)(void))f; +@end + +typedef void (^void_block_t)(void); + +@interface YY { + void_block_t __completion; +} +@property (copy) void_block_t f; +@end + +@implementation Y +- (void (^)(void))f { + return [_private f]; +} + +@end + |