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