1  /* Test to see if the analyzer detect and analyze calls via 
       2     function pointers or not.  */
       3  
       4  #include <stdlib.h>
       5  
       6  void fun(int *int_ptr)
       7  {
       8  	free(int_ptr); /* { dg-warning "double-'free' of 'int_ptr'" } */
       9  }
      10  
      11  void single_call()
      12  {
      13  	int *int_ptr = (int*)malloc(sizeof(int));
      14  	void (*fun_ptr)(int *) = &fun;
      15  	(*fun_ptr)(int_ptr);
      16  }
      17  
      18  void double_call()
      19  {
      20  	int *int_ptr = (int*)malloc(sizeof(int));
      21  	void (*fun_ptr)(int *) = &fun;
      22  	(*fun_ptr)(int_ptr); /* { dg-message "calling 'fun' from 'double_call'" } */
      23  	(*fun_ptr)(int_ptr);
      24  }