Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/ipa/propmalloc-3.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children | 1830386684a0 |
line wrap: on
line source
/* { dg-do compile } */ /* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */ static void *foo(__SIZE_TYPE__, int) __attribute__((noinline, no_icf, used)); __attribute__((noinline, used, no_icf)) static void *bar(__SIZE_TYPE__ n, int m) { return foo (n, m); } static void *foo(__SIZE_TYPE__ n, int m) { void *p; if (m > 0) p = bar (n, --m); else p = __builtin_malloc (n); return p; } /* { dg-final { scan-ipa-dump "Function foo found to be malloc" "pure-const" } } */ /* { dg-final { scan-ipa-dump "Function bar found to be malloc" "pure-const" } } */