From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Wed, 17 Apr 2024 14:20:39 +0200
Subject: Merging upstream version 1.70.0+dfsg1.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 tests/run-make/issue-28595/Makefile |  7 +++++++
 tests/run-make/issue-28595/a.c      |  1 +
 tests/run-make/issue-28595/a.rs     |  6 ++++++
 tests/run-make/issue-28595/b.c      |  5 +++++
 tests/run-make/issue-28595/b.rs     | 12 ++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 tests/run-make/issue-28595/Makefile
 create mode 100644 tests/run-make/issue-28595/a.c
 create mode 100644 tests/run-make/issue-28595/a.rs
 create mode 100644 tests/run-make/issue-28595/b.c
 create mode 100644 tests/run-make/issue-28595/b.rs

(limited to 'tests/run-make/issue-28595')

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();
+    }
+}
-- 
cgit v1.2.3