summaryrefslogtreecommitdiffstats
path: root/tests/run-make-fulldeps/share-generics-dylib/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/run-make-fulldeps/share-generics-dylib/Makefile
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make-fulldeps/share-generics-dylib/Makefile')
-rw-r--r--tests/run-make-fulldeps/share-generics-dylib/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/run-make-fulldeps/share-generics-dylib/Makefile b/tests/run-make-fulldeps/share-generics-dylib/Makefile
new file mode 100644
index 000000000..065fb574c
--- /dev/null
+++ b/tests/run-make-fulldeps/share-generics-dylib/Makefile
@@ -0,0 +1,22 @@
+# 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 ../../run-make-fulldeps/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