Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8e78d16

Browse files
committedMay 18, 2024
Auto merge of rust-lang#125233 - jieyouxu:rollup-76hk8qu, r=jieyouxu
Rollup of 3 pull requests Successful merges: - rust-lang#125213 (Migrate `run-make/static-unwinding` to `rmake`) - rust-lang#125215 (Migrate `run-make/issue64319` to `rmake` and rename) - rust-lang#125221 (Migrate `run-make/issue-28766` to `rmake`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9b75a43 + 650bbb5 commit 8e78d16

File tree

12 files changed

+79
-56
lines changed

12 files changed

+79
-56
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

-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ run-make/issue-25581/Makefile
103103
run-make/issue-26006/Makefile
104104
run-make/issue-26092/Makefile
105105
run-make/issue-28595/Makefile
106-
run-make/issue-28766/Makefile
107106
run-make/issue-30063/Makefile
108107
run-make/issue-33329/Makefile
109108
run-make/issue-35164/Makefile
@@ -128,7 +127,6 @@ run-make/issue-85401-static-mir/Makefile
128127
run-make/issue-85441/Makefile
129128
run-make/issue-88756-default-output/Makefile
130129
run-make/issue-97463-abi-param-passing/Makefile
131-
run-make/issue64319/Makefile
132130
run-make/jobserver-error/Makefile
133131
run-make/libs-through-symlinks/Makefile
134132
run-make/libtest-json/Makefile
@@ -263,7 +261,6 @@ run-make/stable-symbol-names/Makefile
263261
run-make/static-dylib-by-default/Makefile
264262
run-make/static-extern-type/Makefile
265263
run-make/static-pie/Makefile
266-
run-make/static-unwinding/Makefile
267264
run-make/staticlib-blank-lib/Makefile
268265
run-make/staticlib-dylib-linkage/Makefile
269266
run-make/std-core-cycle/Makefile
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// The crate "foo" tied to this test executes a very specific function,
2+
// which involves boxing an instance of the struct Foo. However,
3+
// this once caused a segmentation fault in cargo release builds due to an LLVM
4+
// incorrect assertion.
5+
// This test checks that this bug does not resurface.
6+
// See https://github.com/rust-lang/rust/issues/28766
7+
8+
use run_make_support::{rustc, tmp_dir};
9+
10+
fn main() {
11+
rustc().opt().input("foo.rs").run();
12+
rustc().opt().library_search_path(tmp_dir()).input("main.rs").run();
13+
}

‎tests/run-make/issue-28766/Makefile

-5
This file was deleted.

‎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+
}

‎tests/run-make/static-unwinding/Makefile

-8
This file was deleted.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// During unwinding, an implementation of Drop is possible to clean up resources.
2+
// This test implements drop in both a main function and its static library.
3+
// If the test succeeds, a Rust program being a static library does not affect Drop implementations.
4+
// See https://github.com/rust-lang/rust/issues/10434
5+
6+
//@ ignore-cross-compile
7+
//@ needs-unwind
8+
9+
use run_make_support::{run, rustc};
10+
11+
fn main() {
12+
rustc().input("lib.rs").run();
13+
rustc().input("main.rs").run();
14+
run("main");
15+
}

0 commit comments

Comments
 (0)
Failed to load comments.