aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/225 link language
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/225 link language
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/225 link language')
-rw-r--r--meson/test cases/common/225 link language/c_linkage.cpp5
-rw-r--r--meson/test cases/common/225 link language/c_linkage.h10
-rw-r--r--meson/test cases/common/225 link language/lib.cpp5
-rw-r--r--meson/test cases/common/225 link language/main.c5
-rw-r--r--meson/test cases/common/225 link language/meson.build18
5 files changed, 43 insertions, 0 deletions
diff --git a/meson/test cases/common/225 link language/c_linkage.cpp b/meson/test cases/common/225 link language/c_linkage.cpp
new file mode 100644
index 000000000..dc006b936
--- /dev/null
+++ b/meson/test cases/common/225 link language/c_linkage.cpp
@@ -0,0 +1,5 @@
+extern "C" {
+ int makeInt(void) {
+ return 0;
+ }
+}
diff --git a/meson/test cases/common/225 link language/c_linkage.h b/meson/test cases/common/225 link language/c_linkage.h
new file mode 100644
index 000000000..1609f4702
--- /dev/null
+++ b/meson/test cases/common/225 link language/c_linkage.h
@@ -0,0 +1,10 @@
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int makeInt(void);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/meson/test cases/common/225 link language/lib.cpp b/meson/test cases/common/225 link language/lib.cpp
new file mode 100644
index 000000000..ab4382832
--- /dev/null
+++ b/meson/test cases/common/225 link language/lib.cpp
@@ -0,0 +1,5 @@
+extern "C" {
+ int makeInt(void) {
+ return 1;
+ }
+}
diff --git a/meson/test cases/common/225 link language/main.c b/meson/test cases/common/225 link language/main.c
new file mode 100644
index 000000000..5a167e785
--- /dev/null
+++ b/meson/test cases/common/225 link language/main.c
@@ -0,0 +1,5 @@
+#include "c_linkage.h"
+
+int main(void) {
+ return makeInt();
+}
diff --git a/meson/test cases/common/225 link language/meson.build b/meson/test cases/common/225 link language/meson.build
new file mode 100644
index 000000000..f9af6cd32
--- /dev/null
+++ b/meson/test cases/common/225 link language/meson.build
@@ -0,0 +1,18 @@
+project(
+ 'link_language',
+ ['c', 'cpp'],
+)
+
+exe = executable(
+ 'main',
+ ['main.c', 'c_linkage.cpp'],
+ link_language : 'c',
+)
+
+lib = library(
+ 'mylib',
+ ['lib.cpp'],
+ link_language : 'c',
+)
+
+test('main', exe)