assign-prop-with-arc-runtime.m.result revision d1e40d5389a4382cbebc97d54792f41ee0414af4
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result
2// RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only %s > %t
3// RUN: diff %t %s.result
4
5#include "Common.h"
6
7__attribute__((objc_arc_weak_reference_unavailable))
8@interface WeakOptOut
9@end
10
11@class _NSCachedAttributedString;
12typedef _NSCachedAttributedString *BadClassForWeak;
13
14@class Forw;
15
16@interface Foo : NSObject {
17  Foo *__weak x, *__weak w, *__weak q1, *__weak q2;
18  WeakOptOut *__unsafe_unretained oo;
19  BadClassForWeak __unsafe_unretained bcw;
20  id __unsafe_unretained not_safe1;
21  NSObject *__unsafe_unretained not_safe2;
22  Forw *__unsafe_unretained not_safe3;
23  Foo *assign_plus1;
24}
25@property (readonly) Foo *x;
26@property (weak) Foo *w;
27@property (weak) Foo *q1, *q2;
28@property (unsafe_unretained) WeakOptOut *oo;
29@property (unsafe_unretained) BadClassForWeak bcw;
30@property (unsafe_unretained) id not_safe1;
31@property (unsafe_unretained) NSObject *not_safe2;
32@property (unsafe_unretained) Forw *not_safe3;
33@property (readonly) Foo *assign_plus1;
34@property (strong, readonly) Foo *assign_plus2;
35@property (strong, readonly) Foo *assign_plus3;
36
37@property (weak) Foo *no_user_ivar1;
38@property (weak, readonly) Foo *no_user_ivar2;
39@end
40
41@implementation Foo
42@synthesize x,w,q1,q2,oo,bcw,not_safe1,not_safe2,not_safe3;
43@synthesize no_user_ivar1, no_user_ivar2;
44@synthesize assign_plus1, assign_plus2, assign_plus3;
45
46-(void)test:(Foo *)parm {
47  assign_plus1 = [[Foo alloc] init];
48  assign_plus2 = [Foo new];
49  assign_plus3 = parm;
50}
51@end
52