Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / function-ptr-4.c
blob016351a83f6bf4800a8440c8e25dc5dc319e7ff9
1 /* Test to see if the analyzer detect and analyze calls via
2 function pointers or not. */
4 #include <stdlib.h>
6 void fun(int *int_ptr)
8 free(int_ptr); /* { dg-warning "double-'free' of 'int_ptr'" } */
11 void single_call()
13 int *int_ptr = (int*)malloc(sizeof(int));
14 void (*fun_ptr)(int *) = &fun;
15 (*fun_ptr)(int_ptr);
18 void double_call()
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);