More tests for // rdar://17259812
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 12 Jun 2014 16:55:43 +0000 (16:55 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 12 Jun 2014 16:55:43 +0000 (16:55 +0000)
llvm-svn: 210798

clang/test/SemaCXX/ns_returns_retained_block_return.cpp [new file with mode: 0644]
clang/test/SemaObjC/ns_returns_retained_block_return.m

diff --git a/clang/test/SemaCXX/ns_returns_retained_block_return.cpp b/clang/test/SemaCXX/ns_returns_retained_block_return.cpp
new file mode 100644 (file)
index 0000000..9d04536
--- /dev/null
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fblocks -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fsyntax-only -verify %s
+// expected-no-diagnostics
+// rdar://17259812
+
+typedef void (^BT) ();
+
+class S {
+  BT br() __attribute__((ns_returns_retained)) {
+    return ^{};
+  }
+ BT br1() __attribute__((ns_returns_retained));
+};
+
+BT S::br1() {
+    return ^{};
+}
index b7ce429..e5a96ca 100644 (file)
@@ -11,8 +11,12 @@ 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