From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/run-make/share-generics-dylib/Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/run-make/share-generics-dylib/Makefile (limited to 'tests/run-make/share-generics-dylib/Makefile') diff --git a/tests/run-make/share-generics-dylib/Makefile b/tests/run-make/share-generics-dylib/Makefile new file mode 100644 index 000000000..9d97eca80 --- /dev/null +++ b/tests/run-make/share-generics-dylib/Makefile @@ -0,0 +1,23 @@ +# 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::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 -- cgit v1.2.3