aboutsummaryrefslogtreecommitdiff
path: root/test/ARCMT
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-05 08:46:24 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-05 08:46:24 +0000
commit2a2781805a6b55573d369e34c5dcfba307ce83e9 (patch)
treeff43f2a033769f5b737f8bbcd824b32dab57f769 /test/ARCMT
parentc6c54521f95760a5eaf29b668d4bf41fe2af49d7 (diff)
[arcmt]
-Make sure we don't change to '__weak' a __block variable used as output. -Make sure we don't apply __weak twice. Fixes rdar://10520757&10521362 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ARCMT')
-rw-r--r--test/ARCMT/rewrite-block-var.m20
-rw-r--r--test/ARCMT/rewrite-block-var.m.result20
2 files changed, 40 insertions, 0 deletions
diff --git a/test/ARCMT/rewrite-block-var.m b/test/ARCMT/rewrite-block-var.m
index e6a8fb72e0..538f16c255 100644
--- a/test/ARCMT/rewrite-block-var.m
+++ b/test/ARCMT/rewrite-block-var.m
@@ -23,3 +23,23 @@ void test2(Foo *p) {
x = [p something];
});
}
+
+void test3(Foo *p) {
+ __block Foo *x; // __block used as output variable.
+ bar(^{
+ [x something];
+ });
+ bar(^{
+ x = 0;
+ });
+}
+
+void test4(Foo *p) {
+ __block Foo *x = p; // __block used just to break cycle.
+ bar(^{
+ [x something];
+ });
+ bar(^{
+ [x something];
+ });
+}
diff --git a/test/ARCMT/rewrite-block-var.m.result b/test/ARCMT/rewrite-block-var.m.result
index 27c81bd588..a9d0b0f7fa 100644
--- a/test/ARCMT/rewrite-block-var.m.result
+++ b/test/ARCMT/rewrite-block-var.m.result
@@ -23,3 +23,23 @@ void test2(Foo *p) {
x = [p something];
});
}
+
+void test3(Foo *p) {
+ __block Foo *x; // __block used as output variable.
+ bar(^{
+ [x something];
+ });
+ bar(^{
+ x = 0;
+ });
+}
+
+void test4(Foo *p) {
+ __weak Foo *x = p; // __block used just to break cycle.
+ bar(^{
+ [x something];
+ });
+ bar(^{
+ [x something];
+ });
+}