Author: george.karpenkov Date: Wed Dec 5 17:21:38 2018 New Revision: 348443
URL: http://llvm.org/viewvc/llvm-project?rev=348443&view=rev Log: [attributes] Add more tests for os_returns_retained Modified: cfe/trunk/test/Sema/attr-osobject.mm Modified: cfe/trunk/test/Sema/attr-osobject.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-osobject.mm?rev=348443&r1=348442&r2=348443&view=diff ============================================================================== --- cfe/trunk/test/Sema/attr-osobject.mm (original) +++ cfe/trunk/test/Sema/attr-osobject.mm Wed Dec 5 17:21:38 2018 @@ -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; +}; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits