(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
malloc-ipa-1.c
       1  #include <stdlib.h>
       2  
       3  void *
       4  calls_malloc (void)
       5  {
       6    void *result = malloc (1024);
       7    return result;
       8  }
       9  
      10  int *test_1 (int i)
      11  {
      12    int *ptr = (int *)calls_malloc ();
      13    *ptr = i; /* { dg-warning "dereference of possibly-NULL 'ptr'" } */
      14    return ptr;
      15  }
      16  
      17  /* Same as test_1, to exercise the caches.  */
      18  
      19  int *test_2 (int i)
      20  {
      21    int *ptr = (int *)calls_malloc ();
      22    *ptr = i; /* { dg-warning "dereference of possibly-NULL 'ptr'" } */
      23    return ptr;
      24  }