From b116a7f12d88255c7cb7cd06a7ac339da1773091 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 12 Jun 2014 16:55:43 +0000 Subject: [PATCH] More tests for // rdar://17259812 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210798 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../ns_returns_retained_block_return.cpp | 17 +++++++++++++++++ .../SemaObjC/ns_returns_retained_block_return.m | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 test/SemaCXX/ns_returns_retained_block_return.cpp diff --git a/test/SemaCXX/ns_returns_retained_block_return.cpp b/test/SemaCXX/ns_returns_retained_block_return.cpp new file mode 100644 index 0000000000..9d04536e0f --- /dev/null +++ b/test/SemaCXX/ns_returns_retained_block_return.cpp @@ -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 ^{}; +} diff --git a/test/SemaObjC/ns_returns_retained_block_return.m b/test/SemaObjC/ns_returns_retained_block_return.m index b7ce429ffb..e5a96ca8af 100644 --- a/test/SemaObjC/ns_returns_retained_block_return.m +++ b/test/SemaObjC/ns_returns_retained_block_return.m @@ -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 -- 2.40.0