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 | 12932a0 | 2012-02-22 21:13:49 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp |
Fariborz Jahanian | 84ed600 | 2010-01-07 18:18:32 +0000 | [diff] [blame] | 3 | // radar 7490331 |
| 4 | |
Fariborz Jahanian | 12932a0 | 2012-02-22 21:13:49 +0000 | [diff] [blame] | 5 | void *sel_registerName(const char *); |
| 6 | |
Fariborz Jahanian | 84ed600 | 2010-01-07 18:18:32 +0000 | [diff] [blame] | 7 | @interface Foo { |
| 8 | int a; |
| 9 | id b; |
| 10 | } |
| 11 | - (void)bar; |
| 12 | - (void)baz:(id)q; |
| 13 | @end |
| 14 | |
| 15 | @implementation Foo |
Fariborz Jahanian | c374cd9 | 2010-01-11 17:50:35 +0000 | [diff] [blame] | 16 | // radar 7522803 |
| 17 | static void foo(id bar) { |
| 18 | int i = ((Foo *)bar)->a; |
| 19 | } |
| 20 | |
Fariborz Jahanian | 84ed600 | 2010-01-07 18:18:32 +0000 | [diff] [blame] | 21 | - (void)bar { |
| 22 | a = 42; |
| 23 | [self baz:b]; |
| 24 | } |
| 25 | - (void)baz:(id)q { |
| 26 | } |
| 27 | @end |
| 28 | |