diff options
Diffstat (limited to '')
4 files changed, 34 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/static-dylib-by-default/Makefile b/src/test/run-make-fulldeps/static-dylib-by-default/Makefile new file mode 100644 index 000000000..6409aa66a --- /dev/null +++ b/src/test/run-make-fulldeps/static-dylib-by-default/Makefile @@ -0,0 +1,16 @@ +-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/src/test/run-make-fulldeps/static-dylib-by-default/bar.rs b/src/test/run-make-fulldeps/static-dylib-by-default/bar.rs new file mode 100644 index 000000000..14421165e --- /dev/null +++ b/src/test/run-make-fulldeps/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/src/test/run-make-fulldeps/static-dylib-by-default/foo.rs b/src/test/run-make-fulldeps/static-dylib-by-default/foo.rs new file mode 100644 index 000000000..7ebec8720 --- /dev/null +++ b/src/test/run-make-fulldeps/static-dylib-by-default/foo.rs @@ -0,0 +1,4 @@ +#![crate_type = "rlib"] +#![crate_type = "dylib"] + +pub fn foo() {} diff --git a/src/test/run-make-fulldeps/static-dylib-by-default/main.c b/src/test/run-make-fulldeps/static-dylib-by-default/main.c new file mode 100644 index 000000000..5f7f2c27c --- /dev/null +++ b/src/test/run-make-fulldeps/static-dylib-by-default/main.c @@ -0,0 +1,6 @@ +extern void bar(); + +int main() { + bar(); + return 0; +} |