1  #include <stdlib.h>
       2  
       3  static int *calls_malloc(void)
       4  {
       5    return malloc(sizeof(int));
       6  }
       7  
       8  int *test(void)
       9  {
      10    int *p = calls_malloc(); /* { dg-message "possible return of NULL to 'test' from 'calls_malloc'" } */
      11    *p = 42; /* { dg-warning "dereference of possibly-NULL 'p'" } */
      12    return p;
      13  }