John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 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 |
Fariborz Jahanian | 43aa1c3 | 2012-04-16 22:14:01 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D__block="" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp |
Fariborz Jahanian | 20432ef | 2010-07-28 23:27:30 +0000 | [diff] [blame] | 3 | // rdar:// 8243071 |
| 4 | |
| 5 | void x(int y) {} |
| 6 | void f() { |
| 7 | const int bar = 3; |
| 8 | int baz = 4; |
| 9 | __block int bab = 4; |
| 10 | __block const int bas = 5; |
| 11 | void (^b)() = ^{ |
| 12 | x(bar); |
| 13 | x(baz); |
| 14 | x(bab); |
| 15 | x(bas); |
| 16 | b(); |
| 17 | }; |
| 18 | b(); |
| 19 | } |