From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/run-make-fulldeps/archive-duplicate-names/Makefile | 11 +++++++++++ tests/run-make-fulldeps/archive-duplicate-names/bar.c | 1 + tests/run-make-fulldeps/archive-duplicate-names/bar.rs | 5 +++++ tests/run-make-fulldeps/archive-duplicate-names/foo.c | 1 + tests/run-make-fulldeps/archive-duplicate-names/foo.rs | 14 ++++++++++++++ 5 files changed, 32 insertions(+) create mode 100644 tests/run-make-fulldeps/archive-duplicate-names/Makefile create mode 100644 tests/run-make-fulldeps/archive-duplicate-names/bar.c create mode 100644 tests/run-make-fulldeps/archive-duplicate-names/bar.rs create mode 100644 tests/run-make-fulldeps/archive-duplicate-names/foo.c create mode 100644 tests/run-make-fulldeps/archive-duplicate-names/foo.rs (limited to 'tests/run-make-fulldeps/archive-duplicate-names') diff --git a/tests/run-make-fulldeps/archive-duplicate-names/Makefile b/tests/run-make-fulldeps/archive-duplicate-names/Makefile new file mode 100644 index 000000000..bbdcd2a34 --- /dev/null +++ b/tests/run-make-fulldeps/archive-duplicate-names/Makefile @@ -0,0 +1,11 @@ +include ../tools.mk + +all: + mkdir $(TMPDIR)/a + mkdir $(TMPDIR)/b + $(call COMPILE_OBJ,$(TMPDIR)/a/foo.o,foo.c) + $(call COMPILE_OBJ,$(TMPDIR)/b/foo.o,bar.c) + $(AR) crus $(TMPDIR)/libfoo.a $(TMPDIR)/a/foo.o $(TMPDIR)/b/foo.o + $(RUSTC) foo.rs + $(RUSTC) bar.rs + $(call RUN,bar) diff --git a/tests/run-make-fulldeps/archive-duplicate-names/bar.c b/tests/run-make-fulldeps/archive-duplicate-names/bar.c new file mode 100644 index 000000000..e42599986 --- /dev/null +++ b/tests/run-make-fulldeps/archive-duplicate-names/bar.c @@ -0,0 +1 @@ +void bar() {} diff --git a/tests/run-make-fulldeps/archive-duplicate-names/bar.rs b/tests/run-make-fulldeps/archive-duplicate-names/bar.rs new file mode 100644 index 000000000..994a98c2c --- /dev/null +++ b/tests/run-make-fulldeps/archive-duplicate-names/bar.rs @@ -0,0 +1,5 @@ +extern crate foo; + +fn main() { + foo::baz(); +} diff --git a/tests/run-make-fulldeps/archive-duplicate-names/foo.c b/tests/run-make-fulldeps/archive-duplicate-names/foo.c new file mode 100644 index 000000000..85e6cd8c3 --- /dev/null +++ b/tests/run-make-fulldeps/archive-duplicate-names/foo.c @@ -0,0 +1 @@ +void foo() {} diff --git a/tests/run-make-fulldeps/archive-duplicate-names/foo.rs b/tests/run-make-fulldeps/archive-duplicate-names/foo.rs new file mode 100644 index 000000000..0bf13c406 --- /dev/null +++ b/tests/run-make-fulldeps/archive-duplicate-names/foo.rs @@ -0,0 +1,14 @@ +#![crate_type = "rlib"] + +#[link(name = "foo", kind = "static")] +extern "C" { + fn foo(); + fn bar(); +} + +pub fn baz() { + unsafe { + foo(); + bar(); + } +} -- cgit v1.2.3