Argyrios Kyrtzidis | 7cfd7fe | 2011-11-08 02:02:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-runtime-has-weak -fobjc-arc -x objective-c %s.result |
| 2 | // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c %s > %t |
| 3 | // RUN: diff %t %s.result |
| 4 | // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t |
| 5 | // RUN: diff %t %s.result |
| 6 | |
| 7 | #include "Common.h" |
| 8 | #include "GC.h" |
| 9 | |
| 10 | void test1(CFTypeRef *cft) { |
| 11 | id x = CFBridgingRelease(cft); |
| 12 | } |
| 13 | |
Argyrios Kyrtzidis | 63787f0 | 2012-02-25 01:57:42 +0000 | [diff] [blame] | 14 | @interface I1 |
Argyrios Kyrtzidis | 7cfd7fe | 2011-11-08 02:02:38 +0000 | [diff] [blame] | 15 | @end |
| 16 | |
| 17 | @implementation I1 |
| 18 | -(void)dealloc { |
| 19 | // dealloc |
| 20 | test1(0); |
| 21 | } |
| 22 | |
| 23 | @end |
| 24 | |
| 25 | @interface I2 |
Fariborz Jahanian | 86f9601 | 2012-01-20 19:15:02 +0000 | [diff] [blame] | 26 | @property (strong) id prop; |
Argyrios Kyrtzidis | 7cfd7fe | 2011-11-08 02:02:38 +0000 | [diff] [blame] | 27 | @end |
| 28 | |
| 29 | @implementation I2 |
| 30 | @synthesize prop; |
| 31 | |
| 32 | -(void)dealloc { |
| 33 | // finalize |
| 34 | test1(0); |
| 35 | } |
| 36 | @end |
| 37 | |
| 38 | __attribute__((objc_arc_weak_reference_unavailable)) |
| 39 | @interface QQ { |
| 40 | __unsafe_unretained id s; |
| 41 | __unsafe_unretained QQ *q; |
| 42 | } |
| 43 | @end |
| 44 | |
| 45 | @interface I3 |
| 46 | @property (unsafe_unretained) I3 * pw1, * pw2; |
| 47 | @property (strong) I3 * ps; |
| 48 | @property (assign) I3 * pds; |
| 49 | @end |
| 50 | |
| 51 | @interface I4Impl { |
Fariborz Jahanian | 2f72ec9 | 2012-01-21 00:43:53 +0000 | [diff] [blame] | 52 | I4Impl *__strong pds2; |
Argyrios Kyrtzidis | 7cfd7fe | 2011-11-08 02:02:38 +0000 | [diff] [blame] | 53 | } |
| 54 | @property (unsafe_unretained) I4Impl * pw1, * pw2; |
Fariborz Jahanian | 2f72ec9 | 2012-01-21 00:43:53 +0000 | [diff] [blame] | 55 | @property (strong) I4Impl * ps; |
| 56 | @property (strong) I4Impl * pds; |
| 57 | @property (strong) I4Impl * pds2; |
Argyrios Kyrtzidis | 7cfd7fe | 2011-11-08 02:02:38 +0000 | [diff] [blame] | 58 | @end |
| 59 | |
| 60 | @implementation I4Impl |
| 61 | @synthesize pw1, pw2, ps, pds, pds2; |
| 62 | |
| 63 | -(void)test1:(CFTypeRef *)cft { |
| 64 | id x = CFBridgingRelease(cft); |
| 65 | } |
| 66 | @end |
Argyrios Kyrtzidis | 6da4274 | 2011-11-28 02:04:36 +0000 | [diff] [blame] | 67 | |
| 68 | @interface I5 { |
| 69 | __unsafe_unretained id prop; |
| 70 | } |
| 71 | @property (unsafe_unretained, readonly) id prop; |
| 72 | @end |