diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-08-14 22:06:01 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-08-14 22:06:01 +0000 |
commit | 8d091dbe132e9f9de8d1a1188a77609d22523b6b (patch) | |
tree | dd4652048d5201d38d206eb1cfa90191d0436314 /clang/test | |
parent | f22c410efa1ec345881996ebf987a83da4552803 (diff) | |
download | bcm5719-llvm-8d091dbe132e9f9de8d1a1188a77609d22523b6b.tar.gz bcm5719-llvm-8d091dbe132e9f9de8d1a1188a77609d22523b6b.zip |
Add more attribute 'malloc' test cases involving function pointers.
llvm-svn: 79055
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/attr-malloc.c | 1 | ||||
-rw-r--r-- | clang/test/SemaObjC/attr-malloc.m | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Sema/attr-malloc.c b/clang/test/Sema/attr-malloc.c index 36e8b1d6994..2ad71efebd0 100644 --- a/clang/test/Sema/attr-malloc.c +++ b/clang/test/Sema/attr-malloc.c @@ -12,6 +12,7 @@ typedef int * iptr; 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 diff --git a/clang/test/SemaObjC/attr-malloc.m b/clang/test/SemaObjC/attr-malloc.m index a1a5df96eb1..f18388f4e64 100644 --- a/clang/test/SemaObjC/attr-malloc.m +++ b/clang/test/SemaObjC/attr-malloc.m @@ -10,3 +10,6 @@ id bar(void) __attribute((malloc)); // no-warning typedef void (^bptr)(void); bptr baz(void) __attribute((malloc)); // no-warning +__attribute((malloc)) id (*f)(); // no-warning +__attribute((malloc)) bptr (*g)(); // no-warning + |