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/static-dylib-by-default | |
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/static-dylib-by-default')
-rw-r--r-- | tests/run-make/static-dylib-by-default/Makefile | 17 | ||||
-rw-r--r-- | tests/run-make/static-dylib-by-default/bar.rs | 8 | ||||
-rw-r--r-- | tests/run-make/static-dylib-by-default/foo.rs | 4 | ||||
-rw-r--r-- | tests/run-make/static-dylib-by-default/main.c | 6 |
4 files changed, 35 insertions, 0 deletions
diff --git a/tests/run-make/static-dylib-by-default/Makefile b/tests/run-make/static-dylib-by-default/Makefile new file mode 100644 index 000000000..cdaab42d0 --- /dev/null +++ b/tests/run-make/static-dylib-by-default/Makefile @@ -0,0 +1,17 @@ +# ignore-cross-compile +include ../tools.mk + +TO_LINK := $(call DYLIB,bar) +ifdef IS_MSVC +LINK_ARG = $(TO_LINK:dll=dll.lib) +else +LINK_ARG = $(TO_LINK) +endif + +all: + $(RUSTC) foo.rs + $(RUSTC) bar.rs + $(CC) main.c $(call OUT_EXE,main) $(LINK_ARG) $(EXTRACFLAGS) + rm $(TMPDIR)/*.rlib + rm $(call DYLIB,foo) + $(call RUN,main) diff --git a/tests/run-make/static-dylib-by-default/bar.rs b/tests/run-make/static-dylib-by-default/bar.rs new file mode 100644 index 000000000..14421165e --- /dev/null +++ b/tests/run-make/static-dylib-by-default/bar.rs @@ -0,0 +1,8 @@ +#![crate_type = "dylib"] + +extern crate foo; + +#[no_mangle] +pub extern "C" fn bar() { + foo::foo(); +} diff --git a/tests/run-make/static-dylib-by-default/foo.rs b/tests/run-make/static-dylib-by-default/foo.rs new file mode 100644 index 000000000..7ebec8720 --- /dev/null +++ b/tests/run-make/static-dylib-by-default/foo.rs @@ -0,0 +1,4 @@ +#![crate_type = "rlib"] +#![crate_type = "dylib"] + +pub fn foo() {} diff --git a/tests/run-make/static-dylib-by-default/main.c b/tests/run-make/static-dylib-by-default/main.c new file mode 100644 index 000000000..5f7f2c27c --- /dev/null +++ b/tests/run-make/static-dylib-by-default/main.c @@ -0,0 +1,6 @@ +extern void bar(); + +int main() { + bar(); + return 0; +} |