From 0cd6b9b9f7483a16d5371cf29a5adbdac6078a4b Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Thu, 6 Dec 2018 01:21:38 +0000 Subject: [PATCH] [attributes] Add more tests for os_returns_retained llvm-svn: 348443 --- clang/test/Sema/attr-osobject.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/clang/test/Sema/attr-osobject.mm b/clang/test/Sema/attr-osobject.mm index dbd9122..adabb6d 100644 --- a/clang/test/Sema/attr-osobject.mm +++ b/clang/test/Sema/attr-osobject.mm @@ -1,6 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s - -// expected-no-diagnostics +// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s struct S {}; @@ -9,3 +7,9 @@ struct S {}; - (S*) generateS __attribute__((os_returns_retained)); - (void) takeS:(S*) __attribute__((os_consumed)) s; @end + +typedef __attribute__((os_returns_retained)) id (^blockType)(); // expected-warning{{'os_returns_retained' attribute only applies to functions, Objective-C methods, and Objective-C properties}} + +__auto_type b = ^ id (id filter) __attribute__((os_returns_retained)) { // expected-warning{{'os_returns_retained' attribute only applies to functions, Objective-C methods, and Objective-C properties}} + return filter; +}; -- 2.7.4