diff options
| -rw-r--r-- | src/tools/tidy/src/allowed_run_make_makefiles.txt | 1 | ||||
| -rw-r--r-- | tests/run-make/share-generics-dylib/Makefile | 23 | ||||
| -rw-r--r-- | tests/run-make/share-generics-dylib/rmake.rs | 32 |
3 files changed, 32 insertions, 24 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 7284feadf9c..3f416448f6d 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -50,7 +50,6 @@ run-make/reproducible-build-2/Makefile run-make/reproducible-build/Makefile run-make/rlib-format-packed-bundled-libs-2/Makefile run-make/rlib-format-packed-bundled-libs/Makefile -run-make/share-generics-dylib/Makefile run-make/simd-ffi/Makefile run-make/split-debuginfo/Makefile run-make/stable-symbol-names/Makefile diff --git a/tests/run-make/share-generics-dylib/Makefile b/tests/run-make/share-generics-dylib/Makefile deleted file mode 100644 index 9d97eca80d3..00000000000 --- a/tests/run-make/share-generics-dylib/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# ignore-cross-compile -# This test makes sure all generic instances get re-exported from Rust dylibs for use by -# `-Zshare-generics`. There are two rlibs (`instance_provider_a` and `instance_provider_b`) -# which both provide an instance of `Cell<i32>::set`. There is `instance_user_dylib` which is -# supposed to re-export both these instances, and then there are `instance_user_a_rlib` and -# `instance_user_b_rlib` which each rely on a specific instance to be available. -# -# In the end everything is linked together into `linked_leaf`. If `instance_user_dylib` does -# not export both then we'll get an `undefined reference` error for one of the instances. -# -# This is regression test for https://github.com/rust-lang/rust/issues/67276. - -include ../tools.mk - -COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Csymbol-mangling-version=v0 - -all: - $(RUSTC) instance_provider_a.rs $(COMMON_ARGS) --crate-type=rlib - $(RUSTC) instance_provider_b.rs $(COMMON_ARGS) --crate-type=rlib - $(RUSTC) instance_user_dylib.rs $(COMMON_ARGS) --crate-type=dylib - $(RUSTC) instance_user_a_rlib.rs $(COMMON_ARGS) --crate-type=rlib - $(RUSTC) instance_user_b_rlib.rs $(COMMON_ARGS) --crate-type=rlib - $(RUSTC) linked_leaf.rs $(COMMON_ARGS) --crate-type=bin diff --git a/tests/run-make/share-generics-dylib/rmake.rs b/tests/run-make/share-generics-dylib/rmake.rs new file mode 100644 index 00000000000..8dd402ea1b6 --- /dev/null +++ b/tests/run-make/share-generics-dylib/rmake.rs @@ -0,0 +1,32 @@ +// This test makes sure all generic instances get re-exported from Rust dylibs for use by +// `-Zshare-generics`. There are two rlibs (`instance_provider_a` and `instance_provider_b`) +// which both provide an instance of `Cell<i32>::set`. There is `instance_user_dylib` which is +// supposed to re-export both these instances, and then there are `instance_user_a_rlib` and +// `instance_user_b_rlib` which each rely on a specific instance to be available. +// +// In the end everything is linked together into `linked_leaf`. If `instance_user_dylib` does +// not export both then we'll get an `undefined reference` error for one of the instances. +// +// This is regression test for https://github.com/rust-lang/rust/issues/67276. + +//FIXME(Oneirical): ignore-cross-compile + +use run_make_support::rustc; + +fn main() { + compile("rlib", "instance_provider_a.rs"); + compile("rlib", "instance_provider_b.rs"); + compile("dylib", "instance_user_dylib.rs"); + compile("rlib", "instance_user_a_rlib.rs"); + compile("rlib", "instance_user_b_rlib.rs"); + compile("bin", "linked_leaf.rs"); +} + +fn compile(crate_type: &str, input: &str) { + rustc() + .input(input) + .crate_type(crate_type) + .args(&["-Cprefer-dynamic", "-Zshare-generics=yes", "-Csymbol-mangling-version=v0"]) + .codegen_units(1) + .run(); +} |
