blob: 32d30e53e424c0682c015a66136e8c68cecd032a [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;
Argyrios Kyrtzidisce9b7392011-07-12 22:05:17 +000018 WeakOptOut *oo;
19 BadClassForWeak bcw;
20 id not_safe1;
21 NSObject *not_safe2;
Argyrios Kyrtzidisa2009732011-07-12 22:16:25 +000022 Forw *not_safe3;
John McCalld70fb982011-06-15 23:25:17 +000023}
Argyrios Kyrtzidisce9b7392011-07-12 22:05:17 +000024@property (readonly,assign) Foo *x;
25@property (assign) Foo *w;
Argyrios Kyrtzidisc8b36192011-07-13 19:22:00 +000026@property Foo *q1, *q2;
Argyrios Kyrtzidisce9b7392011-07-12 22:05:17 +000027@property (assign) WeakOptOut *oo;
28@property (assign) BadClassForWeak bcw;
29@property (assign) id not_safe1;
Argyrios Kyrtzidisc8b36192011-07-13 19:22:00 +000030@property () NSObject *not_safe2;
31@property Forw *not_safe3;
32
33@property (assign) Foo *no_back_ivar;
John McCalld70fb982011-06-15 23:25:17 +000034@end
35
36@implementation Foo
Argyrios Kyrtzidisc8b36192011-07-13 19:22:00 +000037@synthesize x,w,q1,q2,oo,bcw,not_safe1,not_safe2,not_safe3;
38@synthesize no_back_ivar;
John McCalld70fb982011-06-15 23:25:17 +000039@end