(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
malloc-ipa-3.c
       1  #include <stdlib.h>
       2  
       3  void *
       4  calls_malloc (void)
       5  {
       6    void *result = malloc (1024);
       7    return result;
       8  }
       9  
      10  void
      11  calls_free (void *victim)
      12  {
      13    free (victim); /* { dg-warning "double-'free' of 'victim'" } */
      14    /* TODO: this would be better emitted at the callsite,
      15       for such a simple wrapper.  */
      16  }
      17  
      18  void test (void)
      19  {
      20    void *ptr = calls_malloc ();
      21    calls_free (ptr);
      22    calls_free (ptr); /* BUG: double-'free'.  */
      23  }