about summary refs log tree commit diff
path: root/tests/run-make/share-generics-export-again/rmake.rs
blob: b9964eb442a288421537635ad6e23a400a3bb007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// When crates had different optimization levels, a bug caused
// incorrect symbol name generations. -Z share-generics could
// also fail to re-export upstream generics on multiple compile
// runs of the same dynamic library.

// This test repeatedly compiles an rlib and a dylib with these flags
// to check if this bug ever returns.

// See https://github.com/rust-lang/rust/pull/68277
// See https://github.com/rust-lang/rust/issues/64319
//@ ignore-cross-compile

use run_make_support::rustc;

fn main() {
    rustc().crate_type("rlib").input("foo.rs").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("3").run();
    rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=no").run();
    rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=yes").run();
    rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=yes").run();
    rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=no").run();
    rustc().crate_type("rlib").input("foo.rs").arg("-Zshare-generics=yes").run();
    rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=yes").run();
    rustc().crate_type("rlib").input("foo.rs").run();
    rustc().crate_type("dylib").input("bar.rs").run();
    rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").arg("-Zshare-generics=yes").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("1").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("1").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("1").arg("-Zshare-generics=yes").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("2").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("2").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("2").arg("-Zshare-generics=yes").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("3").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("3").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("3").arg("-Zshare-generics=yes").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("s").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("s").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("s").arg("-Zshare-generics=yes").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("z").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("z").arg("-Zshare-generics=no").run();
    rustc().crate_type("dylib").input("bar.rs").opt_level("z").arg("-Zshare-generics=yes").run();
}