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