1*c85f09ccSJohn Levon typedef int (*fun_t)(void*);
2*c85f09ccSJohn Levon 
foo(void * a,void * fun)3*c85f09ccSJohn Levon int foo(void *a, void *fun)
4*c85f09ccSJohn Levon {
5*c85f09ccSJohn Levon 	return ((fun_t)fun)(a);
6*c85f09ccSJohn Levon }
7*c85f09ccSJohn Levon 
bar(void * a,void * fun)8*c85f09ccSJohn Levon int bar(void *a, void *fun)
9*c85f09ccSJohn Levon {
10*c85f09ccSJohn Levon 	return ((int (*)(void *))fun)(a);
11*c85f09ccSJohn Levon }
12*c85f09ccSJohn Levon 
qux(void * a,void * fun)13*c85f09ccSJohn Levon int qux(void *a, void *fun)
14*c85f09ccSJohn Levon {
15*c85f09ccSJohn Levon 	return (*(fun_t)fun)(a);
16*c85f09ccSJohn Levon }
17*c85f09ccSJohn Levon 
quz(void * a,void * fun)18*c85f09ccSJohn Levon int quz(void *a, void *fun)
19*c85f09ccSJohn Levon {
20*c85f09ccSJohn Levon 	return (*(int (*)(void *))fun)(a);
21*c85f09ccSJohn Levon }
22*c85f09ccSJohn Levon 
23*c85f09ccSJohn Levon /*
24*c85f09ccSJohn Levon  * check-name: call via casted function pointer
25*c85f09ccSJohn Levon  * check-command: test-linearize -Wno-decl $file
26*c85f09ccSJohn Levon  *
27*c85f09ccSJohn Levon  * check-output-ignore
28*c85f09ccSJohn Levon  * check-output-excludes: load
29*c85f09ccSJohn Levon  * check-output-pattern(4): ptrcast\\..* %arg2
30*c85f09ccSJohn Levon  * check-output-pattern(4): call\\..* %arg1
31*c85f09ccSJohn Levon  */
32