Skip to content
Snippets Groups Projects
Commit 8d091dbe authored by Ted Kremenek's avatar Ted Kremenek
Browse files

Add more attribute 'malloc' test cases involving function pointers.

llvm-svn: 79055
parent f22c410e
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ typedef int * iptr; ...@@ -12,6 +12,7 @@ typedef int * iptr;
iptr returns_iptr (void) __attribute((malloc)); // no-warning iptr returns_iptr (void) __attribute((malloc)); // no-warning
__attribute((malloc)) void *(*f)(); // 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)) __attribute((malloc))
void * xalloc(unsigned n) { return malloc(n); } // no-warning void * xalloc(unsigned n) { return malloc(n); } // no-warning
......
...@@ -10,3 +10,6 @@ id bar(void) __attribute((malloc)); // no-warning ...@@ -10,3 +10,6 @@ id bar(void) __attribute((malloc)); // no-warning
typedef void (^bptr)(void); typedef void (^bptr)(void);
bptr baz(void) __attribute((malloc)); // no-warning bptr baz(void) __attribute((malloc)); // no-warning
__attribute((malloc)) id (*f)(); // no-warning
__attribute((malloc)) bptr (*g)(); // no-warning
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment