|
| 1 | +// When crates had different optimization levels, a bug caused |
| 2 | +// incorrect symbol name generations. -Z share-generics could |
| 3 | +// also fail to re-export upstream generics on multiple compile |
| 4 | +// runs of the same dynamic library. |
| 5 | + |
| 6 | +// This test repeatedly compiles an rlib and a dylib with these flags |
| 7 | +// to check if this bug ever returns. |
| 8 | + |
| 9 | +// See https://github.com/rust-lang/rust/pull/68277 |
| 10 | +// See https://github.com/rust-lang/rust/issues/64319 |
| 11 | +//@ ignore-cross-compile |
| 12 | + |
| 13 | +use run_make_support::rustc; |
| 14 | + |
| 15 | +fn main() { |
| 16 | + rustc().crate_type("rlib").input("foo.rs").run(); |
| 17 | + rustc().crate_type("dylib").input("bar.rs").opt_level("3").run(); |
| 18 | + rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=no").run(); |
| 19 | + rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=no").run(); |
| 20 | + rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=no").run(); |
| 21 | + rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=yes").run(); |
| 22 | + rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=yes").run(); |
| 23 | + rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=no").run(); |
| 24 | + rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=yes").run(); |
| 25 | + rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=yes").run(); |
| 26 | + rustc().crate_type("rlib").input("foo.rs").run(); |
| 27 | + rustc().crate_type("dylib").input("bar.rs").run(); |
| 28 | + rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=no").run(); |
| 29 | + rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=yes").run(); |
| 30 | + rustc().crate_type("dylib").input("bar.rs").opt_level("1").run(); |
| 31 | + rustc().crate_type("dylib").input("bar.rs").opt_level("1").arg("-Zshare-generics=no").run(); |
| 32 | + rustc().crate_type("dylib").input("bar.rs").opt_level("1").arg("-Zshare-generics=yes").run(); |
| 33 | + rustc().crate_type("dylib").input("bar.rs").opt_level("2").run(); |
| 34 | + rustc().crate_type("dylib").input("bar.rs").opt_level("2").arg("-Zshare-generics=no").run(); |
| 35 | + rustc().crate_type("dylib").input("bar.rs").opt_level("2").arg("-Zshare-generics=yes").run(); |
| 36 | + rustc().crate_type("dylib").input("bar.rs").opt_level("3").run(); |
| 37 | + rustc().crate_type("dylib").input("bar.rs").opt_level("3").arg("-Zshare-generics=no").run(); |
| 38 | + rustc().crate_type("dylib").input("bar.rs").opt_level("3").arg("-Zshare-generics=yes").run(); |
| 39 | + rustc().crate_type("dylib").input("bar.rs").opt_level("s").run(); |
| 40 | + rustc().crate_type("dylib").input("bar.rs").opt_level("s").arg("-Zshare-generics=no").run(); |
| 41 | + rustc().crate_type("dylib").input("bar.rs").opt_level("s").arg("-Zshare-generics=yes").run(); |
| 42 | + rustc().crate_type("dylib").input("bar.rs").opt_level("z").run(); |
| 43 | + rustc().crate_type("dylib").input("bar.rs").opt_level("z").arg("-Zshare-generics=no").run(); |
| 44 | + rustc().crate_type("dylib").input("bar.rs").opt_level("z").arg("-Zshare-generics=yes").run(); |
| 45 | +} |
0 commit comments