Skip to content

Commit 1e4d821

Browse files
committed
rewrite pgo-gen to rmake
1 parent 11dd90f commit 1e4d821

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ pub fn shallow_find_files<P: AsRef<Path>, F: Fn(&PathBuf) -> bool>(
272272
for entry in fs_wrapper::read_dir(path) {
273273
let entry = entry.expect("failed to read directory entry.");
274274
let path = entry.path();
275-
276275
if path.is_file() && closure(&path) {
277276
matching_files.push(path);
278277
}

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ run-make/pass-non-c-like-enum-to-c/Makefile
109109
run-make/pdb-buildinfo-cl-cmd/Makefile
110110
run-make/pgo-gen-lto/Makefile
111111
run-make/pgo-gen-no-imp-symbols/Makefile
112-
run-make/pgo-gen/Makefile
113112
run-make/pgo-indirect-call-promotion/Makefile
114113
run-make/pgo-use/Makefile
115114
run-make/pointer-auth-link-with-c/Makefile

tests/run-make/pgo-gen/Makefile

-11
This file was deleted.

tests/run-make/pgo-gen/rmake.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// -C profile-generate, when used with rustc, is supposed to output
2+
// profile files (.profraw) after running a binary to analyze how the compiler
3+
// optimizes code. This test checks that these files are generated.
4+
// See https://github.com/rust-lang/rust/pull/48346
5+
6+
//@ needs-profiler-support
7+
//@ ignore-cross-compile
8+
9+
use run_make_support::{cwd, find_files_by_prefix_and_extension, run, rustc};
10+
11+
fn main() {
12+
rustc().arg("-g").profile_generate(cwd()).run();
13+
run("test");
14+
assert!(
15+
find_files_by_prefix_and_extension(cwd(), "default", "profraw").len() > 0,
16+
"no .profraw file generated"
17+
);
18+
}

0 commit comments

Comments
 (0)