blob: 4e4ae774a25c289da0bb30caef3fd987b4b0524f [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
Argyrios Kyrtzidisde223c32011-07-13 19:47:57 +000033@property (assign) Foo *no_user_ivar1;
34@property (readonly) Foo *no_user_ivar2;
John McCalld70fb982011-06-15 23:25:17 +000035@end
36
37@implementation Foo
Argyrios Kyrtzidisc8b36192011-07-13 19:22:00 +000038@synthesize x,w,q1,q2,oo,bcw,not_safe1,not_safe2,not_safe3;
Argyrios Kyrtzidisde223c32011-07-13 19:47:57 +000039@synthesize no_user_ivar1, no_user_ivar2;
John McCalld70fb982011-06-15 23:25:17 +000040@end