[cfe-commits] r79055 - in /cfe/trunk/test: Sema/attr-malloc.c SemaObjC/attr-malloc.m
Ted Kremenek
kremenek at apple.com
Fri Aug 14 15:06:01 PDT 2009
Author: kremenek
Date: Fri Aug 14 17:06:01 2009
New Revision: 79055
URL: http://llvm.org/viewvc/llvm-project?rev=79055&view=rev
Log:
Add more attribute 'malloc' test cases involving function pointers.
Modified:
cfe/trunk/test/Sema/attr-malloc.c
cfe/trunk/test/SemaObjC/attr-malloc.m
Modified: cfe/trunk/test/Sema/attr-malloc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-malloc.c?rev=79055&r1=79054&r2=79055&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-malloc.c (original)
+++ cfe/trunk/test/Sema/attr-malloc.c Fri Aug 14 17:06:01 2009
@@ -12,6 +12,7 @@
iptr returns_iptr (void) __attribute((malloc)); // no-warning
__attribute((malloc)) void *(*f)(); // no-warning
+__attribute((malloc)) int (*g)(); // expected-warning{{'malloc' attribute only applies to functions returning pointer type}}
__attribute((malloc))
void * xalloc(unsigned n) { return malloc(n); } // no-warning
Modified: cfe/trunk/test/SemaObjC/attr-malloc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-malloc.m?rev=79055&r1=79054&r2=79055&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/attr-malloc.m (original)
+++ cfe/trunk/test/SemaObjC/attr-malloc.m Fri Aug 14 17:06:01 2009
@@ -10,3 +10,6 @@
typedef void (^bptr)(void);
bptr baz(void) __attribute((malloc)); // no-warning
+__attribute((malloc)) id (*f)(); // no-warning
+__attribute((malloc)) bptr (*g)(); // no-warning
+
More information about the cfe-commits
mailing list