aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/ns_returns_retained_block_return.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/ns_returns_retained_block_return.m')
-rw-r--r--test/SemaObjC/ns_returns_retained_block_return.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaObjC/ns_returns_retained_block_return.m b/test/SemaObjC/ns_returns_retained_block_return.m
new file mode 100644
index 000000000000..e5a96ca8af18
--- /dev/null
+++ b/test/SemaObjC/ns_returns_retained_block_return.m
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fblocks -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
+// rdar://17259812
+
+typedef void (^BT) ();
+
+BT foo() __attribute__((ns_returns_retained));
+
+@interface I
+BT foo() __attribute__((ns_returns_retained));
+- (BT) Meth __attribute__((ns_returns_retained));
++ (BT) ClsMeth __attribute__((ns_returns_retained));
+@end
+
+@implementation I
+BT foo() __attribute__((ns_returns_retained)) {return ^{}; }
+- (BT) Meth {return ^{}; }
++ (BT) ClsMeth {return ^{}; }
+@end