summaryrefslogtreecommitdiffstats
path: root/tests/run-make/issue-28595
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/issue-28595')
-rw-r--r--tests/run-make/issue-28595/Makefile7
-rw-r--r--tests/run-make/issue-28595/a.c1
-rw-r--r--tests/run-make/issue-28595/a.rs6
-rw-r--r--tests/run-make/issue-28595/b.c5
-rw-r--r--tests/run-make/issue-28595/b.rs12
5 files changed, 31 insertions, 0 deletions
diff --git a/tests/run-make/issue-28595/Makefile b/tests/run-make/issue-28595/Makefile
new file mode 100644
index 000000000..258f9788a
--- /dev/null
+++ b/tests/run-make/issue-28595/Makefile
@@ -0,0 +1,7 @@
+# ignore-cross-compile
+include ../tools.mk
+
+all: $(call NATIVE_STATICLIB,a) $(call NATIVE_STATICLIB,b)
+ $(RUSTC) a.rs
+ $(RUSTC) b.rs
+ $(call RUN,b)
diff --git a/tests/run-make/issue-28595/a.c b/tests/run-make/issue-28595/a.c
new file mode 100644
index 000000000..7bfd83cca
--- /dev/null
+++ b/tests/run-make/issue-28595/a.c
@@ -0,0 +1 @@
+void a(void) {}
diff --git a/tests/run-make/issue-28595/a.rs b/tests/run-make/issue-28595/a.rs
new file mode 100644
index 000000000..07863cf64
--- /dev/null
+++ b/tests/run-make/issue-28595/a.rs
@@ -0,0 +1,6 @@
+#![crate_type = "rlib"]
+
+#[link(name = "a", kind = "static")]
+extern "C" {
+ pub fn a();
+}
diff --git a/tests/run-make/issue-28595/b.c b/tests/run-make/issue-28595/b.c
new file mode 100644
index 000000000..6aecb5f9e
--- /dev/null
+++ b/tests/run-make/issue-28595/b.c
@@ -0,0 +1,5 @@
+extern void a(void);
+
+void b(void) {
+ a();
+}
diff --git a/tests/run-make/issue-28595/b.rs b/tests/run-make/issue-28595/b.rs
new file mode 100644
index 000000000..1f389859f
--- /dev/null
+++ b/tests/run-make/issue-28595/b.rs
@@ -0,0 +1,12 @@
+extern crate a;
+
+#[link(name = "b", kind = "static")]
+extern "C" {
+ pub fn b();
+}
+
+fn main() {
+ unsafe {
+ b();
+ }
+}