summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-12 22:05:17 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-12 22:05:17 +0000
commitce9b73999974bf2efae2dd614dcec67017b817fe (patch)
treee14d2658166b51d3f944ebc90a6d5af5a87c67ad /clang/test
parentc0f6af21037789f7fc6c1c44014d3c527482e574 (diff)
downloadbcm5719-llvm-ce9b73999974bf2efae2dd614dcec67017b817fe.tar.gz
bcm5719-llvm-ce9b73999974bf2efae2dd614dcec67017b817fe.zip
[arcmt] Before applying '__weak' check whether the objc class is annotated with objc_arc_weak_reference_unavailable
or is in a list of classes not supporting 'weak'. rdar://9489367. llvm-svn: 135002
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/ARCMT/assign-prop-with-arc-runtime.m30
-rw-r--r--clang/test/ARCMT/assign-prop-with-arc-runtime.m.result30
2 files changed, 46 insertions, 14 deletions
diff --git a/clang/test/ARCMT/assign-prop-with-arc-runtime.m b/clang/test/ARCMT/assign-prop-with-arc-runtime.m
index 8d9f21115c5..e9416fe0292 100644
--- a/clang/test/ARCMT/assign-prop-with-arc-runtime.m
+++ b/clang/test/ARCMT/assign-prop-with-arc-runtime.m
@@ -4,16 +4,32 @@
#include "Common.h"
+__attribute__((objc_arc_weak_reference_unavailable))
+@interface WeakOptOut
+@end
+
+@class _NSCachedAttributedString;
+
+typedef _NSCachedAttributedString *BadClassForWeak;
+
@interface Foo : NSObject {
- NSObject *x, *w, *q1, *q2;
- NSObject *z1, *__unsafe_unretained z2;
+ Foo *x, *w, *q1, *q2;
+ Foo *z1, *__unsafe_unretained z2;
+ WeakOptOut *oo;
+ BadClassForWeak bcw;
+ id not_safe1;
+ NSObject *not_safe2;
}
-@property (readonly,assign) id x;
-@property (assign) id w;
-@property (assign) id q1, q2;
-@property (assign) id z1, z2;
+@property (readonly,assign) Foo *x;
+@property (assign) Foo *w;
+@property (assign) Foo *q1, *q2;
+@property (assign) Foo *z1, *z2;
+@property (assign) WeakOptOut *oo;
+@property (assign) BadClassForWeak bcw;
+@property (assign) id not_safe1;
+@property (assign) NSObject *not_safe2;
@end
@implementation Foo
-@synthesize x,w,q1,q2,z1,z2;
+@synthesize x,w,q1,q2,z1,z2,oo,bcw,not_safe1,not_safe2;
@end
diff --git a/clang/test/ARCMT/assign-prop-with-arc-runtime.m.result b/clang/test/ARCMT/assign-prop-with-arc-runtime.m.result
index 2d74ae2ed9f..349bfa28c45 100644
--- a/clang/test/ARCMT/assign-prop-with-arc-runtime.m.result
+++ b/clang/test/ARCMT/assign-prop-with-arc-runtime.m.result
@@ -4,16 +4,32 @@
#include "Common.h"
+__attribute__((objc_arc_weak_reference_unavailable))
+@interface WeakOptOut
+@end
+
+@class _NSCachedAttributedString;
+
+typedef _NSCachedAttributedString *BadClassForWeak;
+
@interface Foo : NSObject {
- NSObject *__weak x, *__weak w, *__weak q1, *__weak q2;
- NSObject *__unsafe_unretained z1, *__unsafe_unretained z2;
+ Foo *__weak x, *__weak w, *__weak q1, *__weak q2;
+ Foo *__unsafe_unretained z1, *__unsafe_unretained z2;
+ WeakOptOut *__unsafe_unretained oo;
+ BadClassForWeak __unsafe_unretained bcw;
+ id __unsafe_unretained not_safe1;
+ NSObject *__unsafe_unretained not_safe2;
}
-@property (readonly,weak) id x;
-@property (weak) id w;
-@property (weak) id q1, q2;
-@property (assign) id z1, z2;
+@property (readonly,weak) Foo *x;
+@property (weak) Foo *w;
+@property (weak) Foo *q1, *q2;
+@property (assign) Foo *z1, *z2;
+@property (assign) WeakOptOut *oo;
+@property (assign) BadClassForWeak bcw;
+@property (assign) id not_safe1;
+@property (assign) NSObject *not_safe2;
@end
@implementation Foo
-@synthesize x,w,q1,q2,z1,z2;
+@synthesize x,w,q1,q2,z1,z2,oo,bcw,not_safe1,not_safe2;
@end
OpenPOWER on IntegriCloud