blob: f416b6622f455ba7fa538d21eee641b97ffe6493 [file] [log] [blame]
John McCall5fb5df92012-06-20 06:18:46 +00001// 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
NAKAMURA Takumi9a660022012-05-01 10:52:06 +00002// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"SEL=void*" -U__declspec -D"__declspec(X)=" %t-rw.cpp
Fariborz Jahaniancc172282012-04-16 22:14:01 +00003// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
NAKAMURA Takumi9a660022012-05-01 10:52:06 +00004// RUN: %clang_cc1 -fsyntax-only -Werror -Wno-address-of-temporary -D"SEL=void*" -U__declspec -D"__declspec(X)=" %t-modern-rw.cpp
Fariborz Jahaniance2ea592010-02-26 19:55:31 +00005// radar 7692350
6
Fariborz Jahanian2e7f6382012-05-03 21:44:12 +00007// rdar://11375908
8typedef unsigned long size_t;
9
Fariborz Jahaniance2ea592010-02-26 19:55:31 +000010void f(void (^block)(void));
11
12@interface X {
13 int y;
14}
15- (void)foo;
16@end
17
18@implementation X
19- (void)foo {
20 __block int kerfluffle;
Fariborz Jahanian6005bd82010-02-26 22:49:11 +000021 // radar 7692183
Richard Smith3b870382013-04-30 22:43:51 +000022 __block int x;
Fariborz Jahaniance2ea592010-02-26 19:55:31 +000023 f(^{
24 f(^{
25 y = 42;
26 kerfluffle = 1;
Fariborz Jahanian6005bd82010-02-26 22:49:11 +000027 x = 2;
Fariborz Jahaniance2ea592010-02-26 19:55:31 +000028 });
29 });
30}
31@end