summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/attr-ownership.c
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-07-31 20:44:26 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-07-31 20:44:26 +0000
commitef7aef8fe5d3c6150991629404a3090e61566f08 (patch)
tree510e307bcde5714bc46778b99a89b7614caf0429 /clang/test/Sema/attr-ownership.c
parent914efc72391b4c30d527b7ed0e5bbed0e5de0484 (diff)
downloadbcm5719-llvm-ef7aef8fe5d3c6150991629404a3090e61566f08.tar.gz
bcm5719-llvm-ef7aef8fe5d3c6150991629404a3090e61566f08.zip
Implemented a diagnostic to handle multiple, distinct ownership_return attributes on the same declaration. This removes a FIXME from the code.
llvm-svn: 214436
Diffstat (limited to 'clang/test/Sema/attr-ownership.c')
-rw-r--r--clang/test/Sema/attr-ownership.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Sema/attr-ownership.c b/clang/test/Sema/attr-ownership.c
index 2aa9f9f27cc..d2e48c65a23 100644
--- a/clang/test/Sema/attr-ownership.c
+++ b/clang/test/Sema/attr-ownership.c
@@ -17,3 +17,8 @@ void *f12(float i, int k, int f, int *j) __attribute__((ownership_returns(foo, 4
void f13(int *i, int *j) __attribute__((ownership_holds(foo, 1))) __attribute__((ownership_takes(foo, 2)));
void f14(int i, int j, int *k) __attribute__((ownership_holds(foo, 3))) __attribute__((ownership_takes(foo, 3))); // expected-error {{'ownership_holds' and 'ownership_takes' attributes are not compatible}}
+
+void f15(int, int)
+ __attribute__((ownership_returns(foo, 1))) // expected-note {{declared with index 1 here}}
+ __attribute__((ownership_returns(foo, 2))); // expected-error {{'ownership_returns' attribute index does not match; here it is 2}}
+void f16(int *i, int *j) __attribute__((ownership_holds(foo, 1))) __attribute__((ownership_holds(foo, 1))); // OK, same index
OpenPOWER on IntegriCloud