OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-12.c
1 /* Copyright (C) 2003  Free Software Foundation.
2
3    Verify that all the malloc-like __builtin_ allocation functions are
4    recognized by the compiler.
5
6    Written by Roger Sayle, 12th April 2003.  */
7
8 /* { dg-do compile } */
9 /* { dg-final { scan-assembler-not "__builtin_" } } */
10
11 typedef __SIZE_TYPE__ size_t;
12
13 void *test1(size_t n)
14 {
15   return __builtin_malloc(n);
16 }
17
18 void *test2(size_t n, size_t s)
19 {
20   return __builtin_calloc(n,s);
21 }
22
23 char *test3(const char *ptr)
24 {
25   return __builtin_strdup(ptr);
26 }
27