1extern int fun(void);
2extern int (*ptr)(void);
3
4static inline int inl(int *a)
5{
6	return *a + 1;
7}
8
9
10int test(void);
11int test(void)
12{
13	unsigned int s = 0;
14
15	// OK
16	s += sizeof &fun;
17	s += sizeof  ptr;
18	s += sizeof &ptr;
19	s += sizeof &inl;
20
21	// KO
22	s += sizeof  fun;
23	s += sizeof *fun;
24
25	s += sizeof *ptr;
26
27	s += sizeof  inl;
28	s += sizeof *inl;
29
30	s += sizeof  __builtin_trap;
31	s += sizeof *__builtin_trap;
32
33	return s;
34}
35
36/*
37 * check-name: sizeof-function
38 * check-command: sparse -Wpointer-arith -Wno-decl $file
39 *
40 * check-error-start
41sizeof-function.c:22:14: warning: expression using sizeof on a function
42sizeof-function.c:23:14: warning: expression using sizeof on a function
43sizeof-function.c:25:14: warning: expression using sizeof on a function
44sizeof-function.c:27:14: warning: expression using sizeof on a function
45sizeof-function.c:28:14: warning: expression using sizeof on a function
46sizeof-function.c:30:14: warning: expression using sizeof on a function
47sizeof-function.c:31:14: warning: expression using sizeof on a function
48 * check-error-end
49 */
50