summaryrefslogtreecommitdiffstats
path: root/tools/tools/shlib-compat/test/libtest1
diff options
context:
space:
mode:
authorgleb <gleb@FreeBSD.org>2013-03-25 00:31:14 +0000
committergleb <gleb@FreeBSD.org>2013-03-25 00:31:14 +0000
commit6fa7e98571a4ba3ef27bb02c1c5bdf9328da7333 (patch)
treee9fa302d11d1d8240b8af9d2d682fe2a9a04159c /tools/tools/shlib-compat/test/libtest1
parente740fd1ca7e847599c7467d1112041207db09ec0 (diff)
downloadFreeBSD-src-6fa7e98571a4ba3ef27bb02c1c5bdf9328da7333.zip
FreeBSD-src-6fa7e98571a4ba3ef27bb02c1c5bdf9328da7333.tar.gz
Add shlib-compat under tools.
shlib-compat is ABI compatibility checker for shared libraries with symbol versioning.
Diffstat (limited to 'tools/tools/shlib-compat/test/libtest1')
-rw-r--r--tools/tools/shlib-compat/test/libtest1/Makefile6
-rw-r--r--tools/tools/shlib-compat/test/libtest1/Symbol.map12
-rw-r--r--tools/tools/shlib-compat/test/libtest1/test.c66
3 files changed, 84 insertions, 0 deletions
diff --git a/tools/tools/shlib-compat/test/libtest1/Makefile b/tools/tools/shlib-compat/test/libtest1/Makefile
new file mode 100644
index 0000000..32d77d4
--- /dev/null
+++ b/tools/tools/shlib-compat/test/libtest1/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+TESTNUM= 1
+
+.include <../Makefile.inc>
+.include <bsd.lib.mk>
diff --git a/tools/tools/shlib-compat/test/libtest1/Symbol.map b/tools/tools/shlib-compat/test/libtest1/Symbol.map
new file mode 100644
index 0000000..67649ae
--- /dev/null
+++ b/tools/tools/shlib-compat/test/libtest1/Symbol.map
@@ -0,0 +1,12 @@
+/*
+ * $FreeBSD$
+ */
+
+TEST_1.0 {
+ func1;
+ func2;
+ func3;
+ func4;
+ func5;
+ func6;
+};
diff --git a/tools/tools/shlib-compat/test/libtest1/test.c b/tools/tools/shlib-compat/test/libtest1/test.c
new file mode 100644
index 0000000..dc3a561
--- /dev/null
+++ b/tools/tools/shlib-compat/test/libtest1/test.c
@@ -0,0 +1,66 @@
+/*
+ * $FreeBSD$
+ */
+
+#include <sys/types.h>
+#include <sys/stdint.h>
+
+struct s1 {
+ int32_t f1_int;
+ char *f2_str;
+ short f3_short;
+ uint64_t f4_uint64;
+ intmax_t f5_intmax;
+ void* f6_ptr;
+};
+
+struct s2 {
+ char f1_buf[30];
+ struct s1 *f2_s1;
+};
+
+struct s3 {
+ struct s1 f1_s1;
+ uint32_t f2_int32;
+};
+
+int func1(int a, int b);
+int func2(int64_t a, uint64_t b);
+void func3(struct s1 *s);
+void func4(struct s1 s);
+int func5(int a, void *b, struct s2 *s);
+int func6(char a, struct s3 *s);
+
+int
+func1(int a, int b)
+{
+ return (a - b);
+}
+
+int
+func2(int64_t a, uint64_t b)
+{
+ return (a - b);
+}
+
+void
+func3(struct s1 *s)
+{
+}
+
+void
+func4(struct s1 s)
+{
+}
+
+int
+func5(int a, void *b, struct s2 *s)
+{
+ return (0);
+}
+
+int
+func6(char a, struct s3 *s)
+{
+ return (0);
+}
OpenPOWER on IntegriCloud