aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/builtins-12.c
blob: 61a80edf78f00e96bb35fbdbca6d56a8beb61ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Copyright (C) 2003  Free Software Foundation.

   Verify that all the malloc-like __builtin_ allocation functions are
   recognized by the compiler.

   Written by Roger Sayle, 12th April 2003.  */

/* { dg-do compile } */
/* { dg-options "-ansi" } */
/* { dg-final { scan-assembler-not "__builtin_" } } */

typedef __SIZE_TYPE__ size_t;

void *test1(size_t n)
{
  return __builtin_malloc(n);
}

void *test2(size_t n, size_t s)
{
  return __builtin_calloc(n,s);
}

char *test3(const char *ptr)
{
  return __builtin_strdup(ptr);
}