xref: /llvm-project/clang/test/Rewriter/rewrite-block-literal-1.mm (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
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 -std=gnu++98 -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
4// RUN: %clang_cc1 -fsyntax-only -std=gnu++98 -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
5
6
7typedef unsigned long size_t;
8
9void *sel_registerName(const char *);
10typedef void (^BLOCK_TYPE)(void);
11
12@interface CoreDAVTaskGroup
13{
14  int IVAR;
15}
16@property int IVAR;
17- (void) setCompletionBlock : (BLOCK_TYPE) arg;
18@end
19
20@implementation CoreDAVTaskGroup
21- (void)_finishInitialSync {
22                    CoreDAVTaskGroup *folderPost;
23  folderPost.completionBlock = ^{
24    self.IVAR = 0;
25    [self _finishInitialSync];
26  };
27
28  [folderPost setCompletionBlock : (^{
29    self.IVAR = 0;
30  })];
31}
32@dynamic IVAR;
33- (void) setCompletionBlock : (BLOCK_TYPE) arg {}
34@end
35
36
37