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