summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/ns_returns_retained_block_return.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/ns_returns_retained_block_return.m b/clang/test/SemaObjC/ns_returns_retained_block_return.m
new file mode 100644
index 00000000000..b7ce429ffb0
--- /dev/null
+++ b/clang/test/SemaObjC/ns_returns_retained_block_return.m
@@ -0,0 +1,18 @@
+// 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));
+@end
+
+@implementation I
+BT foo() __attribute__((ns_returns_retained)) {return ^{}; }
+@end
OpenPOWER on IntegriCloud