| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ |
| 3 |
|
| 4 |
#include <stdlib.h> |
| 5 |
#include <string.h> |
| 6 |
|
| 7 |
void *r; |
| 8 |
void *r2; |
| 9 |
void *r3; |
| 10 |
void *r4; |
| 11 |
void *r5; |
| 12 |
|
| 13 |
void *m (size_t s, int c) |
| 14 |
{ |
| 15 |
r = malloc (s); |
| 16 |
if (r) |
| 17 |
memset (r, 0, s); |
| 18 |
|
| 19 |
r2 = calloc (s, 0); |
| 20 |
if (r2) |
| 21 |
memset (r2, 0, s); |
| 22 |
|
| 23 |
r3 = __builtin_malloc (s); |
| 24 |
if (r3) |
| 25 |
memset (r3, 0, s); |
| 26 |
|
| 27 |
r4 = __builtin_calloc (s, 0); |
| 28 |
if (r4) |
| 29 |
memset (r4, 0, s); |
| 30 |
|
| 31 |
r5 = __builtin_realloc (r4, s); |
| 32 |
if (r5) |
| 33 |
memset (r4, 0, s); |
| 34 |
} |
| 35 |
|
| 36 |
/* { dg-final { scan-tree-dump-times "malloc returned non-NULL heuristics of edge\[^:\]*: 99.96%" 5 "profile_estimate"} } */ |