blob: 8603cc05a54d90bb77e806ce0bae2d3d79c12b4b [file] [log] [blame]
Ryan Flynn1f1fdc02009-08-09 20:07:29 +00001// RUN: clang-cc -verify -fsyntax-only %s &&
2// RUN: clang-cc -emit-llvm -o %t %s &&
3
4#include <stdlib.h>
5
6int no_vars __attribute((malloc)); // expected-warning {{only applies to function types}}
7
8__attribute((malloc))
9void * xalloc(unsigned n) { return malloc(n); }
10// RUN: grep 'define noalias .* @xalloc(' %t &&
11
12#define __malloc_like __attribute((__malloc__))
13void * xalloc2(unsigned) __malloc_like;
14void * xalloc2(unsigned n) { return malloc(n); }
15// RUN: grep 'define noalias .* @xalloc2(' %t
16