Fariborz Jahanian | 9e0393d | 2012-02-04 19:06:06 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-fragile-abi %s -o %t-rw.cpp |
Fariborz Jahanian | 72952fc | 2010-03-01 23:36:21 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp |
Fariborz Jahanian | 43aa1c3 | 2012-04-16 22:14:01 +0000 | [diff] [blame] | 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 -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp |
Fariborz Jahanian | 72952fc | 2010-03-01 23:36:21 +0000 | [diff] [blame] | 5 | // radar 7696893 |
| 6 | |
Fariborz Jahanian | 8b08adb | 2012-05-03 21:44:12 +0000 | [diff] [blame] | 7 | typedef unsigned long size_t; |
Fariborz Jahanian | 72952fc | 2010-03-01 23:36:21 +0000 | [diff] [blame] | 8 | void *sel_registerName(const char *); |
| 9 | |
| 10 | void f(void (^block)(void)); |
| 11 | void f2(id); |
| 12 | void f3(int); |
| 13 | char f4(id, id); |
| 14 | |
| 15 | @interface Baz |
| 16 | - (void)b:(void (^)(void))block; |
| 17 | @end |
| 18 | |
| 19 | @interface Bar |
| 20 | @end |
| 21 | |
| 22 | @interface Foo { |
| 23 | int _x; |
| 24 | } |
| 25 | @end |
| 26 | |
| 27 | @implementation Foo |
| 28 | - (void)method:(Bar *)up { |
| 29 | Baz *down; |
| 30 | int at; |
| 31 | id cq; |
| 32 | __block char didit = 'a'; |
| 33 | __block char upIsFinished = 'b'; |
| 34 | f(^{ |
| 35 | id old_cq; |
| 36 | f2(cq); |
| 37 | [down b:^{ |
| 38 | [down b:^{ |
| 39 | f(^{ |
| 40 | didit = f4(up, down); |
| 41 | upIsFinished = 'c'; |
| 42 | self->_x++; |
| 43 | }); |
| 44 | }]; |
| 45 | }]; |
| 46 | f2(old_cq); |
| 47 | f3(at); |
| 48 | }); |
| 49 | } |
| 50 | @end |