aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/120 extract all shared library
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/120 extract all shared library
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/120 extract all shared library')
-rw-r--r--meson/test cases/common/120 extract all shared library/extractor.h6
-rw-r--r--meson/test cases/common/120 extract all shared library/four.c5
-rw-r--r--meson/test cases/common/120 extract all shared library/func1234.def5
-rw-r--r--meson/test cases/common/120 extract all shared library/meson.build14
-rw-r--r--meson/test cases/common/120 extract all shared library/one.c5
-rw-r--r--meson/test cases/common/120 extract all shared library/prog.c10
-rw-r--r--meson/test cases/common/120 extract all shared library/three.c5
-rw-r--r--meson/test cases/common/120 extract all shared library/two.c5
8 files changed, 55 insertions, 0 deletions
diff --git a/meson/test cases/common/120 extract all shared library/extractor.h b/meson/test cases/common/120 extract all shared library/extractor.h
new file mode 100644
index 000000000..cfb7ff6d6
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/extractor.h
@@ -0,0 +1,6 @@
+#pragma once
+
+int func1(void);
+int func2(void);
+int func3(void);
+int func4(void);
diff --git a/meson/test cases/common/120 extract all shared library/four.c b/meson/test cases/common/120 extract all shared library/four.c
new file mode 100644
index 000000000..f67a85e68
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/four.c
@@ -0,0 +1,5 @@
+#include"extractor.h"
+
+int func4(void) {
+ return 4;
+}
diff --git a/meson/test cases/common/120 extract all shared library/func1234.def b/meson/test cases/common/120 extract all shared library/func1234.def
new file mode 100644
index 000000000..d62c08d78
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/func1234.def
@@ -0,0 +1,5 @@
+EXPORTS
+ func1
+ func2
+ func3
+ func4
diff --git a/meson/test cases/common/120 extract all shared library/meson.build b/meson/test cases/common/120 extract all shared library/meson.build
new file mode 100644
index 000000000..340c031b7
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/meson.build
@@ -0,0 +1,14 @@
+project('extract all', 'c', 'cpp')
+
+if meson.backend() == 'xcode'
+ error('MESON_SKIP_TEST: Xcode backend does not handle libraries with only objects, not sources.')
+endif
+
+a = static_library('a', 'one.c', 'two.c')
+b = static_library('b', 'three.c', 'four.c')
+c = shared_library('c',
+ objects : [a.extract_all_objects(), b.extract_all_objects()],
+ vs_module_defs : 'func1234.def')
+
+e = executable('proggie', 'prog.c', link_with : c)
+test('extall', e)
diff --git a/meson/test cases/common/120 extract all shared library/one.c b/meson/test cases/common/120 extract all shared library/one.c
new file mode 100644
index 000000000..152a1455d
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/one.c
@@ -0,0 +1,5 @@
+#include"extractor.h"
+
+int func1(void) {
+ return 1;
+}
diff --git a/meson/test cases/common/120 extract all shared library/prog.c b/meson/test cases/common/120 extract all shared library/prog.c
new file mode 100644
index 000000000..de0cc7f8e
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/prog.c
@@ -0,0 +1,10 @@
+#include"extractor.h"
+#include<stdio.h>
+
+int main(void) {
+ if((1+2+3+4) != (func1() + func2() + func3() + func4())) {
+ printf("Arithmetic is fail.\n");
+ return 1;
+ }
+ return 0;
+}
diff --git a/meson/test cases/common/120 extract all shared library/three.c b/meson/test cases/common/120 extract all shared library/three.c
new file mode 100644
index 000000000..24604ed72
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/three.c
@@ -0,0 +1,5 @@
+#include"extractor.h"
+
+int func3(void) {
+ return 3;
+}
diff --git a/meson/test cases/common/120 extract all shared library/two.c b/meson/test cases/common/120 extract all shared library/two.c
new file mode 100644
index 000000000..800cd2dfb
--- /dev/null
+++ b/meson/test cases/common/120 extract all shared library/two.c
@@ -0,0 +1,5 @@
+#include"extractor.h"
+
+int func2(void) {
+ return 2;
+}