]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/share-generics-dylib/Makefile
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / run-make-fulldeps / share-generics-dylib / Makefile
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
14 COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Csymbol-mangling-version=v0
15
16 all:
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