aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear/call-casted-pointer.c
blob: e66f69990a602e420f321dfe7f053fa8a1b28cfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
typedef int (*fun_t)(void*);

int foo(void *a, void *fun)
{
	return ((fun_t)fun)(a);
}

int bar(void *a, void *fun)
{
	return ((int (*)(void *))fun)(a);
}

int qux(void *a, void *fun)
{
	return (*(fun_t)fun)(a);
}

int quz(void *a, void *fun)
{
	return (*(int (*)(void *))fun)(a);
}

/*
 * check-name: call via casted function pointer
 * check-command: test-linearize -Wno-decl $file
 * check-known-to-fail
 *
 * check-output-ignore
 * check-output-excludes: load
 * check-output-pattern(4): ptrcast\..* %arg2
 * check-output-pattern(4): call\..* %arg1
 */