Skip to content

Commit 617b52f

Browse files
committed
Auto merge of #126709 - Oneirical:exitestial-crisis, r=<try>
Migrate `include_bytes_deps`, `optimization-remarks-dir-pgo`, `optimization-remarks-dir`, `issue-40535` and `rmeta-preferred` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Needs BSD tryjob. try-job: dist-x86_64-freebsd
2 parents 5c8459f + 61b9273 commit 617b52f

File tree

18 files changed

+107
-70
lines changed

18 files changed

+107
-70
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ run-make/forced-unwind-terminate-pof/Makefile
5757
run-make/foreign-double-unwind/Makefile
5858
run-make/foreign-exceptions/Makefile
5959
run-make/foreign-rust-exceptions/Makefile
60-
run-make/include_bytes_deps/Makefile
6160
run-make/incr-add-rust-src-component/Makefile
6261
run-make/incr-foreign-head-span/Makefile
6362
run-make/inline-always-many-cgu/Makefile
@@ -79,7 +78,6 @@ run-make/issue-33329/Makefile
7978
run-make/issue-35164/Makefile
8079
run-make/issue-36710/Makefile
8180
run-make/issue-37839/Makefile
82-
run-make/issue-40535/Makefile
8381
run-make/issue-47384/Makefile
8482
run-make/issue-47551/Makefile
8583
run-make/issue-68794-textrel-on-minimal-lib/Makefile
@@ -131,8 +129,6 @@ run-make/no-alloc-shim/Makefile
131129
run-make/no-builtins-attribute/Makefile
132130
run-make/no-duplicate-libs/Makefile
133131
run-make/obey-crate-type-flag/Makefile
134-
run-make/optimization-remarks-dir-pgo/Makefile
135-
run-make/optimization-remarks-dir/Makefile
136132
run-make/output-type-permutations/Makefile
137133
run-make/override-aliased-flags/Makefile
138134
run-make/overwrite-input/Makefile
@@ -176,7 +172,6 @@ run-make/rlib-chain/Makefile
176172
run-make/rlib-format-packed-bundled-libs-2/Makefile
177173
run-make/rlib-format-packed-bundled-libs-3/Makefile
178174
run-make/rlib-format-packed-bundled-libs/Makefile
179-
run-make/rmeta-preferred/Makefile
180175
run-make/rustc-macro-dep-files/Makefile
181176
run-make/rustdoc-io-error/Makefile
182177
run-make/sanitizer-cdylib-link/Makefile
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// include_bytes! and include_str! in `main.rs`
2+
// should register the included file as of #24423,
3+
// and this test checks that this is still the case.
4+
// See https://github.com/rust-lang/rust/pull/24423
5+
6+
//FIXME(Oneirical): check if works without ignore freebsd
7+
8+
use run_make_support::{invalid_utf8_contains, rustc};
9+
10+
fn main() {
11+
rustc().emit("dep-info").input("main.rs").run();
12+
invalid_utf8_contains("main.d", "input.txt");
13+
invalid_utf8_contains("main.d", "input.bin");
14+
invalid_utf8_contains("main.d", "input.md");
15+
}

tests/run-make/include_bytes_deps/Makefile

-7
This file was deleted.

tests/run-make/issue-40535/Makefile

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// In a dependency hierarchy, metadata-only crates could cause an Internal
2+
// Compiler Error (ICE) due to a compiler bug - not correctly fetching sources for
3+
// metadata-only crates. This test is a minimal reproduction of a program that triggered
4+
// this bug, and checks that no ICE occurs.
5+
// See https://github.com/rust-lang/rust/issues/40535
6+
7+
use run_make_support::rustc;
8+
9+
fn main() {
10+
rustc().input("baz.rs").emit("metadata").run();
11+
rustc().input("bar.rs").emit("metadata").extern_("baz", "libbaz.rmeta").run();
12+
// There should be no internal compiler error message.
13+
rustc()
14+
.input("foo.rs")
15+
.emit("metadata")
16+
.extern_("bar", "libbaz.rmeta")
17+
.run()
18+
.assert_stderr_not_contains("unexpectedly panicked");
19+
}

tests/run-make/optimization-remarks-dir-pgo/Makefile

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// This test checks the -Zremark-dir flag, which writes LLVM
2+
// optimization remarks to the YAML format. When using PGO (Profile
3+
// Guided Optimization), the Hotness attribute should be included in
4+
// the output remark files.
5+
// See https://github.com/rust-lang/rust/pull/114439
6+
7+
//@ needs-profiler-support
8+
//@ ignore-cross-compile
9+
10+
use run_make_support::{invalid_utf8_contains, llvm_profdata, run, rustc};
11+
12+
fn main() {
13+
rustc().profile_generate("profdata").opt().input("foo.rs").output("foo").run();
14+
run("foo");
15+
llvm_profdata()
16+
.merge()
17+
.output("merged.profdata")
18+
.input("profdata/default_15907418011457399462_0.profraw")
19+
.run();
20+
rustc()
21+
.profile_use("merged.profdata")
22+
.opt()
23+
.input("foo.rs")
24+
.arg("-Cremark=all")
25+
.arg("-Zremark-dir=profiles")
26+
.run();
27+
// Check that PGO hotness is included in the remark files
28+
invalid_utf8_contains("profiles/foo.cba44757bc0621b9-cgu.0.opt.opt.yaml", "Hotness");
29+
}

tests/run-make/optimization-remarks-dir/Makefile

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// In this test, the function `bar` has #[inline(never)] and the function `foo`
2+
// does not. This test outputs LLVM optimization remarks twice - first for all
3+
// functions (including `bar`, and the `inline` mention), and then for only `foo`
4+
// (should not have the `inline` mention).
5+
// See https://github.com/rust-lang/rust/pull/113040
6+
7+
use run_make_support::{invalid_utf8_contains, invalid_utf8_not_contains, rustc};
8+
9+
fn main() {
10+
rustc()
11+
.opt()
12+
.input("foo.rs")
13+
.crate_type("lib")
14+
.arg("-Cremark=all")
15+
.arg("-Zremark-dir=profiles_all")
16+
.run();
17+
invalid_utf8_contains("profiles_all/foo.5be5606e1f6aa79b-cgu.0.opt.opt.yaml", "inline");
18+
rustc()
19+
.opt()
20+
.input("foo.rs")
21+
.crate_type("lib")
22+
.arg("-Cremark=foo")
23+
.arg("-Zremark-dir=profiles_foo")
24+
.run();
25+
invalid_utf8_not_contains("profiles_foo/foo.5be5606e1f6aa79b-cgu.0.opt.opt.yaml", "inline");
26+
}

tests/run-make/rmeta-preferred/Makefile

-16
This file was deleted.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This test compiles `lib.rs`'s dependency, `rmeta_aux.rs`, as both an rlib
2+
// and an rmeta crate. By default, rustc should give the metadata crate (rmeta)
3+
// precedence over the rust-lib (rlib). This test inspects the contents of the binary
4+
// and that the correct (rmeta) crate was used.
5+
// rlibs being preferred could indicate a resurgence of the -Zbinary-dep-depinfo bug
6+
// seen in #68298.
7+
// See https://github.com/rust-lang/rust/pull/37681
8+
9+
//@ ignore-cross-compile
10+
11+
use run_make_support::{invalid_utf8_contains, invalid_utf8_not_contains, rustc};
12+
13+
fn main() {
14+
rustc().input("rmeta_aux.rs").crate_type("rlib").emit("link,metadata").run();
15+
rustc().input("lib.rs").crate_type("rlib").emit("dep-info").arg("-Zbinary-dep-depinfo").run();
16+
invalid_utf8_contains("lib.d", "librmeta_aux.rmeta");
17+
invalid_utf8_not_contains("lib.d", "librmeta_aux.rlib");
18+
}

0 commit comments

Comments
 (0)