1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -verify -fsyntax-only -fblocks %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@interface TestAttrMallocOnMethods {}
4*f4a2713aSLionel Sambuc- (id) test1 __attribute((malloc)); //  expected-warning {{functions returning a pointer type}}
5*f4a2713aSLionel Sambuc- (int) test2 __attribute((malloc)); //  expected-warning {{functions returning a pointer type}}
6*f4a2713aSLionel Sambuc@end
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambucid bar(void) __attribute((malloc)); // no-warning
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuctypedef void (^bptr)(void);
11*f4a2713aSLionel Sambucbptr baz(void) __attribute((malloc)); // no-warning
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc__attribute((malloc)) id (*f)(); //  expected-warning {{functions returning a pointer type}}
14*f4a2713aSLionel Sambuc__attribute((malloc)) bptr (*g)(); //  expected-warning {{functions returning a pointer type}}
15*f4a2713aSLionel Sambuc__attribute((malloc)) void *(^h)(); //  expected-warning {{functions returning a pointer type}}
16*f4a2713aSLionel Sambuc
17