Skip to content

Commit fc4541b

Browse files
committed
rewrite optimization-remarks-dir to rmake
1 parent 8f8c51f commit fc4541b

File tree

4 files changed

+39
-16
lines changed

4 files changed

+39
-16
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ run-make/no-alloc-shim/Makefile
130130
run-make/no-builtins-attribute/Makefile
131131
run-make/no-duplicate-libs/Makefile
132132
run-make/obey-crate-type-flag/Makefile
133-
run-make/optimization-remarks-dir/Makefile
134133
run-make/output-type-permutations/Makefile
135134
run-make/override-aliased-flags/Makefile
136135
run-make/overwrite-input/Makefile

tests/run-make/optimization-remarks-dir-pgo/rmake.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@
77
//@ needs-profiler-support
88
//@ ignore-cross-compile
99

10-
use run_make_support::{run, llvm_profdata, rustc, invalid_utf8_contains};
10+
use run_make_support::{invalid_utf8_contains, llvm_profdata, run, rustc};
1111

1212
fn main() {
1313
rustc().profile_generate("profdata").opt().input("foo.rs").output("foo").run();
1414
run("foo");
15-
llvm_profdata().merge().output("merged.profdata").input("profdata/default_15907418011457399462_0.profraw").run();
16-
rustc().profile_use("merged.profdata").opt().input("foo.rs").arg("-Cremark=all").arg("-Zremark-dir=profiles").run();
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();
1727
// Check that PGO hotness is included in the remark files
1828
invalid_utf8_contains("profiles/foo.cba44757bc0621b9-cgu.0.opt.opt.yaml", "Hotness");
1929
}

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

0 commit comments

Comments
 (0)