(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
ipa/
propmalloc-2.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
       3  
       4  __attribute__((noinline, used, no_icf))
       5  static void *foo (__SIZE_TYPE__ n)
       6  {
       7    return __builtin_malloc (n * 10);
       8  }
       9  
      10  __attribute__((noinline, used, no_icf))
      11  static void *bar(__SIZE_TYPE__ n, int cond)
      12  {
      13    void *p;
      14    if (cond)
      15      p = foo (n);
      16    else
      17      p = __builtin_malloc (n);
      18  
      19    return p;
      20  }
      21  
      22  /* { dg-final { scan-ipa-dump "Function foo/\[0-9+\]+ found to be malloc" "pure-const" } } */
      23  /* { dg-final { scan-ipa-dump "Function bar/\[0-9+\]+ found to be malloc" "pure-const" } } */