blob: 0516e6d69432a99ea29891b4bff8ee437e4eeb0c [file] [log] [blame]
John McCall24fc0de2011-07-06 00:26:06 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result
Argyrios Kyrtzidisbdf3ca92011-06-16 02:41:46 +00002// RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fobjc-nonfragile-abi -fsyntax-only %s > %t
John McCalld70fb982011-06-15 23:25:17 +00003// RUN: diff %t %s.result
4
5#include "Common.h"
6
Argyrios Kyrtzidisce9b7392011-07-12 22:05:17 +00007__attribute__((objc_arc_weak_reference_unavailable))
8@interface WeakOptOut
9@end
10
11@class _NSCachedAttributedString;
Argyrios Kyrtzidisce9b7392011-07-12 22:05:17 +000012typedef _NSCachedAttributedString *BadClassForWeak;
13
Argyrios Kyrtzidisa2009732011-07-12 22:16:25 +000014@class Forw;
15
John McCalld70fb982011-06-15 23:25:17 +000016@interface Foo : NSObject {
Argyrios Kyrtzidisce9b7392011-07-12 22:05:17 +000017 Foo *x, *w, *q1, *q2;
18 Foo *z1, *__unsafe_unretained z2;
19 WeakOptOut *oo;
20 BadClassForWeak bcw;
21 id not_safe1;
22 NSObject *not_safe2;
Argyrios Kyrtzidisa2009732011-07-12 22:16:25 +000023 Forw *not_safe3;
John McCalld70fb982011-06-15 23:25:17 +000024}
Argyrios Kyrtzidisce9b7392011-07-12 22:05:17 +000025@property (readonly,assign) Foo *x;
26@property (assign) Foo *w;
27@property (assign) Foo *q1, *q2;
28@property (assign) Foo *z1, *z2;
29@property (assign) WeakOptOut *oo;
30@property (assign) BadClassForWeak bcw;
31@property (assign) id not_safe1;
32@property (assign) NSObject *not_safe2;
Argyrios Kyrtzidisa2009732011-07-12 22:16:25 +000033@property (assign) Forw *not_safe3;
John McCalld70fb982011-06-15 23:25:17 +000034@end
35
36@implementation Foo
Argyrios Kyrtzidisa2009732011-07-12 22:16:25 +000037@synthesize x,w,q1,q2,z1,z2,oo,bcw,not_safe1,not_safe2,not_safe3;
John McCalld70fb982011-06-15 23:25:17 +000038@end