This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-24
lines changed
tests/run-make/share-generics-dylib Expand file tree Collapse file tree 3 files changed +32
-24
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ run-make/reproducible-build-2/Makefile
5050run-make/reproducible-build/Makefile
5151run-make/rlib-format-packed-bundled-libs-2/Makefile
5252run-make/rlib-format-packed-bundled-libs/Makefile
53- run-make/share-generics-dylib/Makefile
5453run-make/simd-ffi/Makefile
5554run-make/split-debuginfo/Makefile
5655run-make/stable-symbol-names/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ //FIXME(Oneirical): ignore-cross-compile
13+
14+ use run_make_support:: rustc;
15+
16+ fn main ( ) {
17+ compile ( "rlib" , "instance_provider_a.rs" ) ;
18+ compile ( "rlib" , "instance_provider_b.rs" ) ;
19+ compile ( "dylib" , "instance_user_dylib.rs" ) ;
20+ compile ( "rlib" , "instance_user_a_rlib.rs" ) ;
21+ compile ( "rlib" , "instance_user_b_rlib.rs" ) ;
22+ compile ( "bin" , "linked_leaf.rs" ) ;
23+ }
24+
25+ fn compile ( crate_type : & str , input : & str ) {
26+ rustc ( )
27+ . input ( input)
28+ . crate_type ( crate_type)
29+ . args ( & [ "-Cprefer-dynamic" , "-Zshare-generics=yes" , "-Csymbol-mangling-version=v0" ] )
30+ . codegen_units ( 1 )
31+ . run ( ) ;
32+ }
You can’t perform that action at this time.
0 commit comments