aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr83648.c
blob: d3dd12da46c8abc4d6325a6054f96f9b009d7e73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-local-pure-const-details -fdelete-null-pointer-checks" } */
/* { dg-skip-if "" keeps_null_pointer_checks } */

void *g(unsigned n)
{
  return n ? __builtin_malloc (n) : 0;
}

void *h()
{
  return 0;
}

/* { dg-final { scan-tree-dump "Function found to be malloc: g" "local-pure-const1" } } */
/* { dg-final { scan-tree-dump-not "Function found to be malloc: h" "local-pure-const1" } } */