diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/run-make-fulldeps/archive-duplicate-names | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make-fulldeps/archive-duplicate-names')
5 files changed, 32 insertions, 0 deletions
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(); + } +} |