diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
commit | 631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch) | |
tree | a1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/run-make/archive-duplicate-names | |
parent | Adding debian version 1.69.0+dfsg1-1. (diff) | |
download | rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/archive-duplicate-names')
-rw-r--r-- | tests/run-make/archive-duplicate-names/Makefile | 12 | ||||
-rw-r--r-- | tests/run-make/archive-duplicate-names/bar.c | 1 | ||||
-rw-r--r-- | tests/run-make/archive-duplicate-names/bar.rs | 5 | ||||
-rw-r--r-- | tests/run-make/archive-duplicate-names/foo.c | 1 | ||||
-rw-r--r-- | tests/run-make/archive-duplicate-names/foo.rs | 14 |
5 files changed, 33 insertions, 0 deletions
diff --git a/tests/run-make/archive-duplicate-names/Makefile b/tests/run-make/archive-duplicate-names/Makefile new file mode 100644 index 000000000..5433a42d2 --- /dev/null +++ b/tests/run-make/archive-duplicate-names/Makefile @@ -0,0 +1,12 @@ +# ignore-cross-compile +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/archive-duplicate-names/bar.c b/tests/run-make/archive-duplicate-names/bar.c new file mode 100644 index 000000000..e42599986 --- /dev/null +++ b/tests/run-make/archive-duplicate-names/bar.c @@ -0,0 +1 @@ +void bar() {} diff --git a/tests/run-make/archive-duplicate-names/bar.rs b/tests/run-make/archive-duplicate-names/bar.rs new file mode 100644 index 000000000..994a98c2c --- /dev/null +++ b/tests/run-make/archive-duplicate-names/bar.rs @@ -0,0 +1,5 @@ +extern crate foo; + +fn main() { + foo::baz(); +} diff --git a/tests/run-make/archive-duplicate-names/foo.c b/tests/run-make/archive-duplicate-names/foo.c new file mode 100644 index 000000000..85e6cd8c3 --- /dev/null +++ b/tests/run-make/archive-duplicate-names/foo.c @@ -0,0 +1 @@ +void foo() {} diff --git a/tests/run-make/archive-duplicate-names/foo.rs b/tests/run-make/archive-duplicate-names/foo.rs new file mode 100644 index 000000000..0bf13c406 --- /dev/null +++ b/tests/run-make/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(); + } +} |