blob: d7c13af400d03a119187b2521e85eb761228347e [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
__attribute__((noinline, no_icf, used))
static void *f(__SIZE_TYPE__ n)
{
void *p = __builtin_malloc (n);
if (p == 0)
__builtin_abort ();
return p;
}
__attribute__((noinline, no_icf, used))
static void *bar(__SIZE_TYPE__ n)
{
void *p = f (n);
return p;
}
/* { dg-final { scan-ipa-dump "Function f/\[0-9+\]+ found to be malloc" "pure-const" } } */
/* { dg-final { scan-ipa-dump "Function bar/\[0-9+\]+ found to be malloc" "pure-const" } } */