Skip to content

Commit 6ae3612

Browse files
authored
Unrolled build for rust-lang#125215
Rollup merge of rust-lang#125215 - Oneirical:easy-test-the-second, r=jieyouxu Migrate `run-make/issue64319` to `rmake` and rename Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). ~~I noticed that the Makefile was not listed in `allowed-run-makefiles` in Tidy. Does this mean the test was being ignored?~~ EDIT: No, it was there, just not in its expected alphabetical order. EDIT2: Perhaps it could be interesting to clean this test visually by looping over the `rustc` calls, like in rust-lang#125227.
2 parents 9b75a43 + 184be49 commit 6ae3612

File tree

6 files changed

+51
-41
lines changed

6 files changed

+51
-41
lines changed

src/tools/run-make-support/src/rustc.rs

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ impl Rustc {
6464
self
6565
}
6666

67+
/// Specify a specific optimization level.
68+
pub fn opt_level(&mut self, option: &str) -> &mut Self {
69+
self.cmd.arg(format!("-Copt-level={option}"));
70+
self
71+
}
72+
6773
/// Specify type(s) of output files to generate.
6874
pub fn emit(&mut self, kinds: &str) -> &mut Self {
6975
self.cmd.arg(format!("--emit={kinds}"));

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ run-make/issue-85401-static-mir/Makefile
128128
run-make/issue-85441/Makefile
129129
run-make/issue-88756-default-output/Makefile
130130
run-make/issue-97463-abi-param-passing/Makefile
131-
run-make/issue64319/Makefile
132131
run-make/jobserver-error/Makefile
133132
run-make/libs-through-symlinks/Makefile
134133
run-make/libtest-json/Makefile

tests/run-make/issue64319/Makefile

-40
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

Comments
 (0)