• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 -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 -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
5// radar 7682149
6
7
8typedef unsigned long size_t;
9void f(void (^block)(void));
10
11@interface X {
12	int y;
13}
14- (void)foo;
15@end
16
17@implementation X
18- (void)foo {
19    f(^{
20  f(^{
21    f(^{
22      y=42;
23    });
24  });
25});
26
27}
28@end
29
30struct S {
31  int y;
32};
33
34void foo () {
35	struct S *SELF;
36	f(^{
37		f(^{
38			SELF->y = 42;
39		});
40	});
41}
42
43// radar 7692419
44@interface Bar
45@end
46
47void f(Bar *);
48void q(void (^block)(void));
49
50void x() {
51        void (^myblock)(Bar *b) = ^(Bar *b) {
52                q(^{
53                        f(b);
54                });
55        };
56
57        Bar *b = (Bar *)42;
58        myblock(b);
59}
60