1248693Sgleb/* 2248693Sgleb * $FreeBSD: releng/10.2/tools/tools/shlib-compat/test/libtest2/test.c 248693 2013-03-25 00:31:14Z gleb $ 3248693Sgleb */ 4248693Sgleb 5248693Sgleb#include <sys/types.h> 6248693Sgleb#include <sys/stdint.h> 7248693Sgleb 8248693Sglebstruct s1 { 9248693Sgleb int32_t f1_int; 10248693Sgleb char *f2_str; 11248693Sgleb short f3_short; 12248693Sgleb uint64_t f4_uint64; 13248693Sgleb intmax_t f5_intmax; 14248693Sgleb void* f6_ptr; 15248693Sgleb}; 16248693Sgleb 17248693Sglebstruct s2 { 18248693Sgleb char f1_buf[30]; 19248693Sgleb struct s1 *f2_s1; 20248693Sgleb}; 21248693Sgleb 22248693Sglebstruct s3 { 23248693Sgleb struct s1 f1_s1; 24248693Sgleb uint32_t f2_int32; 25248693Sgleb}; 26248693Sgleb 27248693Sglebint func1(uint64_t a, uint64_t b); 28248693Sglebint compat_func1(int a, int b); 29248693Sglebint func2(int64_t a, uint64_t b); 30248693Sglebvoid func3(struct s1 *s); 31248693Sglebvoid func4(struct s1 s); 32248693Sglebint func5(int a, void *b, struct s2 *s); 33248693Sglebint func6(char a, struct s3 *s); 34248693Sgleb 35248693Sglebint 36248693Sglebfunc1(uint64_t a, uint64_t b) 37248693Sgleb{ 38248693Sgleb return (a - b); 39248693Sgleb} 40248693Sgleb 41248693Sglebint 42248693Sglebcompat_func1(int a, int b) 43248693Sgleb{ 44248693Sgleb return func1(a, b); 45248693Sgleb} 46248693Sgleb__sym_compat(func1, compat_func1, TEST_1.0); 47248693Sgleb 48248693Sglebint 49248693Sglebfunc2(int64_t a, uint64_t b) 50248693Sgleb{ 51248693Sgleb return (a - b); 52248693Sgleb} 53248693Sgleb 54248693Sglebvoid 55248693Sglebfunc3(struct s1 *s) 56248693Sgleb{ 57248693Sgleb} 58248693Sgleb 59248693Sglebvoid 60248693Sglebfunc4(struct s1 s) 61248693Sgleb{ 62248693Sgleb} 63248693Sgleb 64248693Sglebint 65248693Sglebfunc5(int a, void *b, struct s2 *s) 66248693Sgleb{ 67248693Sgleb return (0); 68248693Sgleb} 69248693Sgleb 70248693Sglebint 71248693Sglebfunc6(char a, struct s3 *s) 72248693Sgleb{ 73248693Sgleb return (0); 74248693Sgleb} 75