diff options
| author | Joshua Nelson <github@jyn.dev> | 2023-03-30 07:34:55 -0500 |
|---|---|---|
| committer | Joshua Nelson <github@jyn.dev> | 2023-03-30 07:34:55 -0500 |
| commit | 433da1fc047bb39a263eefca4bdb2b1972f1d2ce (patch) | |
| tree | 28540e78fdd5fdf158267e67495121ac64f0866a /tests/run-make/c-dynamic-rlib | |
| parent | f2d9a3d0771504f1ae776226a5799dcb4408a91a (diff) | |
| download | rust-433da1fc047bb39a263eefca4bdb2b1972f1d2ce.tar.gz rust-433da1fc047bb39a263eefca4bdb2b1972f1d2ce.zip | |
Move almost all run-make-fulldeps to run-make
They pass fine.
Diffstat (limited to 'tests/run-make/c-dynamic-rlib')
| -rw-r--r-- | tests/run-make/c-dynamic-rlib/Makefile | 15 | ||||
| -rw-r--r-- | tests/run-make/c-dynamic-rlib/bar.rs | 5 | ||||
| -rw-r--r-- | tests/run-make/c-dynamic-rlib/cfoo.c | 4 | ||||
| -rw-r--r-- | tests/run-make/c-dynamic-rlib/foo.rs | 10 |
4 files changed, 34 insertions, 0 deletions
diff --git a/tests/run-make/c-dynamic-rlib/Makefile b/tests/run-make/c-dynamic-rlib/Makefile new file mode 100644 index 00000000000..c65d648b929 --- /dev/null +++ b/tests/run-make/c-dynamic-rlib/Makefile @@ -0,0 +1,15 @@ +include ../tools.mk + +# ignore-macos +# +# This hits an assertion in the linker on older versions of osx apparently + +# This overrides the LD_LIBRARY_PATH for RUN +TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR) + +all: $(call DYLIB,cfoo) + $(RUSTC) foo.rs + $(RUSTC) bar.rs + $(call RUN,bar) + $(call REMOVE_DYLIBS,cfoo) + $(call FAIL,bar) diff --git a/tests/run-make/c-dynamic-rlib/bar.rs b/tests/run-make/c-dynamic-rlib/bar.rs new file mode 100644 index 00000000000..b8c798ffdb4 --- /dev/null +++ b/tests/run-make/c-dynamic-rlib/bar.rs @@ -0,0 +1,5 @@ +extern crate foo; + +fn main() { + foo::rsfoo(); +} diff --git a/tests/run-make/c-dynamic-rlib/cfoo.c b/tests/run-make/c-dynamic-rlib/cfoo.c new file mode 100644 index 00000000000..fea490cf9b4 --- /dev/null +++ b/tests/run-make/c-dynamic-rlib/cfoo.c @@ -0,0 +1,4 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int foo() { return 0; } diff --git a/tests/run-make/c-dynamic-rlib/foo.rs b/tests/run-make/c-dynamic-rlib/foo.rs new file mode 100644 index 00000000000..3dd376f1ff5 --- /dev/null +++ b/tests/run-make/c-dynamic-rlib/foo.rs @@ -0,0 +1,10 @@ +#![crate_type = "rlib"] + +#[link(name = "cfoo")] +extern "C" { + fn foo(); +} + +pub fn rsfoo() { + unsafe { foo() } +} |
