Avoid expicit builtion list in tree-ssa-dce
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / realloc-pr110014.c
blobe25722a3328ad744fced7f69bdf2abd01cc7f191
1 void *realloc (void *, unsigned long)
2 __attribute__((__nothrow__, __leaf__))
3 __attribute__((__warn_unused_result__)) __attribute__((__alloc_size__ (2)));
5 long *
6 slurp (long *buffer, unsigned long file_size)
8 unsigned long cc;
9 if (!__builtin_add_overflow (file_size - file_size % sizeof (long),
10 2 * sizeof (long), &cc))
11 buffer = (long *) realloc (buffer, cc);
12 return buffer;
15 long *
16 slurp1 (long *buffer, unsigned long file_size)
18 return (long *) realloc (buffer, file_size - file_size % sizeof (long));
21 long *
22 slurp2 (long *buffer, unsigned long file_size)
24 return (long *) realloc (buffer, (file_size / sizeof (long)) * sizeof (long));