xref: /linux/tools/testing/selftests/bpf/progs/btf_data.c (revision 5a8cd539ac19f7a68e68e1d25ef9ca2ff55b8500)
1 // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
2 
3 struct S {
4 	int	a;
5 	int	b;
6 	int	c;
7 };
8 
9 union U {
10 	int	a;
11 	int	b;
12 	int	c;
13 };
14 
15 struct S1 {
16 	int	a;
17 	int	b;
18 	int	c;
19 };
20 
21 union U1 {
22 	int	a;
23 	int	b;
24 	int	c;
25 };
26 
27 typedef int T;
28 typedef int S;
29 typedef int U;
30 typedef int T1;
31 typedef int S1;
32 typedef int U1;
33 
34 struct root_struct {
35 	S		m_1;
36 	T		m_2;
37 	U		m_3;
38 	S1		m_4;
39 	T1		m_5;
40 	U1		m_6;
41 	struct S	m_7;
42 	struct S1	m_8;
43 	union  U	m_9;
44 	union  U1	m_10;
45 };
46 
func(struct root_struct * root)47 int func(struct root_struct *root)
48 {
49 	return 0;
50 }
51 
kfunc_a(struct root_struct * root)52 int kfunc_a(struct root_struct *root)
53 {
54 	return 0;
55 }
56 
kfunc_b(struct root_struct * root)57 int kfunc_b(struct root_struct *root)
58 {
59 	return 0;
60 }
61 
kfunc_c(struct root_struct * a,struct root_struct * b)62 struct root_struct *kfunc_c(struct root_struct *a, struct root_struct *b)
63 {
64 	return a;
65 }
66 
kfunc_d(struct root_struct * a,struct root_struct * b)67 int kfunc_d(struct root_struct *a, struct root_struct *b)
68 {
69 	return 0;
70 }
71 
kfunc_e(struct root_struct * a__arena,struct root_struct * b__arena__nullable,struct root_struct * c__arena,struct root_struct * d__arena__nullable,struct root_struct * e__arena)72 int kfunc_e(struct root_struct *a__arena,
73 	    struct root_struct *b__arena__nullable,
74 	    struct root_struct *c__arena,
75 	    struct root_struct *d__arena__nullable,
76 	    struct root_struct *e__arena)
77 {
78 	return 0;
79 }
80 
kfunc_f(struct root_struct * a,struct root_struct * b__arena,int flags)81 int kfunc_f(struct root_struct *a, struct root_struct *b__arena, int flags)
82 {
83 	return 0;
84 }
85 
kfunc_g(struct root_struct * a__arena,struct root_struct * b__arena__nullable)86 struct root_struct *kfunc_g(struct root_struct *a__arena,
87 			    struct root_struct *b__arena__nullable)
88 {
89 	return a__arena;
90 }
91