]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - tools/tools/shlib-compat/test/libtest2/test.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / tools / tools / shlib-compat / test / libtest2 / test.c
1 /*
2  * $FreeBSD$
3  */
4
5 #include <sys/types.h>
6 #include <sys/stdint.h>
7
8 struct s1 {
9         int32_t         f1_int;
10         char            *f2_str;
11         short           f3_short;
12         uint64_t        f4_uint64;
13         intmax_t        f5_intmax;
14         void*           f6_ptr;
15 };
16
17 struct s2 {
18         char            f1_buf[30];
19         struct s1       *f2_s1;
20 };
21
22 struct s3 {
23         struct s1       f1_s1;
24         uint32_t        f2_int32;
25 };
26
27 int     func1(uint64_t a, uint64_t b);
28 int     compat_func1(int a, int b);
29 int     func2(int64_t a, uint64_t b);
30 void    func3(struct s1 *s);
31 void    func4(struct s1 s);
32 int     func5(int a, void *b, struct s2 *s);
33 int     func6(char a, struct s3 *s);
34
35 int
36 func1(uint64_t a, uint64_t b)
37 {
38         return (a - b);
39 }
40
41 int
42 compat_func1(int a, int b)
43 {
44         return func1(a, b);
45 }
46 __sym_compat(func1, compat_func1, TEST_1.0);
47
48 int
49 func2(int64_t a, uint64_t b)
50 {
51         return (a - b);
52 }
53
54 void
55 func3(struct s1 *s)
56 {
57 }
58
59 void
60 func4(struct s1 s)
61 {
62 }
63
64 int
65 func5(int a, void *b, struct s2 *s)
66 {
67         return (0);
68 }
69
70 int
71 func6(char a, struct s3 *s)
72 {
73         return (0);
74 }