blob: a504b333b51fa8b10d3840869e8d3ff0ca296b0f [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -verify -fsyntax-only -fblocks %s
Ted Kremeneka18d7d82009-08-14 20:49:40 +00002
Ted Kremeneka18d7d82009-08-14 20:49:40 +00003@interface TestAttrMallocOnMethods {}
Ted Kremenek2cff7d12009-08-15 00:51:46 +00004- (id) test1 __attribute((malloc)); // expected-warning {{functions returning a pointer type}}
5- (int) test2 __attribute((malloc)); // expected-warning {{functions returning a pointer type}}
Ted Kremeneka18d7d82009-08-14 20:49:40 +00006@end
7
8id bar(void) __attribute((malloc)); // no-warning
9
10typedef void (^bptr)(void);
11bptr baz(void) __attribute((malloc)); // no-warning
12
Ted Kremenek2cff7d12009-08-15 00:51:46 +000013__attribute((malloc)) id (*f)(); // expected-warning {{functions returning a pointer type}}
14__attribute((malloc)) bptr (*g)(); // expected-warning {{functions returning a pointer type}}
15__attribute((malloc)) void *(^h)(); // expected-warning {{functions returning a pointer type}}
Ted Kremenek2733b662009-08-14 22:06:01 +000016