fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.2 KiB22 linesraw
1# This test makes sure all generic instances get re-exported from Rust dylibs for use by
2# `-Zshare-generics`. There are two rlibs (`instance_provider_a` and `instance_provider_b`)
3# which both provide an instance of `Cell<i32>::set`. There is `instance_user_dylib` which is
4# supposed to re-export both these instances, and then there are `instance_user_a_rlib` and
5# `instance_user_b_rlib` which each rely on a specific instance to be available.
6#
7# In the end everything is linked together into `linked_leaf`. If `instance_user_dylib` does
8# not export both then we'll get an `undefined reference` error for one of the instances.
9#
10# This is regression test for https://github.com/rust-lang/rust/issues/67276.
11
12-include ../../run-make-fulldeps/tools.mk
13
14COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Zsymbol-mangling-version=v0
15
16all:
17	$(RUSTC) instance_provider_a.rs $(COMMON_ARGS) --crate-type=rlib
18	$(RUSTC) instance_provider_b.rs $(COMMON_ARGS) --crate-type=rlib
19	$(RUSTC) instance_user_dylib.rs $(COMMON_ARGS) --crate-type=dylib
20	$(RUSTC) instance_user_a_rlib.rs $(COMMON_ARGS) --crate-type=rlib
21	$(RUSTC) instance_user_b_rlib.rs $(COMMON_ARGS) --crate-type=rlib
22	$(RUSTC) linked_leaf.rs $(COMMON_ARGS) --crate-type=bin