| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -Wsuggest-attribute=malloc -fdelete-null-pointer-checks" } */ |
| 3 |
/* { dg-skip-if "" keeps_null_pointer_checks } */ |
| 4 |
|
| 5 |
__attribute__((noinline)) |
| 6 |
static void *f1(__SIZE_TYPE__ sz) /* { dg-bogus "function might be candidate for attribute 'malloc'" } */ |
| 7 |
{ |
| 8 |
return __builtin_malloc (sz); |
| 9 |
} |
| 10 |
|
| 11 |
__attribute__((noinline)) |
| 12 |
static void *f2(__SIZE_TYPE__ sz) /* { dg-bogus "function might be candidate for attribute 'malloc'" } */ |
| 13 |
{ |
| 14 |
return f1 (sz); |
| 15 |
} |
| 16 |
|
| 17 |
void *f3(__SIZE_TYPE__ sz) /* { dg-warning "function might be candidate for attribute 'malloc'" } */ |
| 18 |
{ |
| 19 |
return f2(sz); |
| 20 |
} |