rewrite pgo-gen to rmake

This commit is contained in:
Oneirical 2024-06-25 13:22:02 -04:00
parent 11dd90f761
commit 1e4d821136
4 changed files with 18 additions and 13 deletions

View File

@ -272,7 +272,6 @@ pub fn shallow_find_files<P: AsRef<Path>, F: Fn(&PathBuf) -> bool>(
for entry in fs_wrapper::read_dir(path) {
let entry = entry.expect("failed to read directory entry.");
let path = entry.path();
if path.is_file() && closure(&path) {
matching_files.push(path);
}

View File

@ -109,7 +109,6 @@ run-make/pass-non-c-like-enum-to-c/Makefile
run-make/pdb-buildinfo-cl-cmd/Makefile
run-make/pgo-gen-lto/Makefile
run-make/pgo-gen-no-imp-symbols/Makefile
run-make/pgo-gen/Makefile
run-make/pgo-indirect-call-promotion/Makefile
run-make/pgo-use/Makefile
run-make/pointer-auth-link-with-c/Makefile

View File

@ -1,11 +0,0 @@
# needs-profiler-support
# ignore-cross-compile
include ../tools.mk
COMPILE_FLAGS=-g -Cprofile-generate="$(TMPDIR)"
all:
$(RUSTC) $(COMPILE_FLAGS) test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)

View File

@ -0,0 +1,18 @@
// -C profile-generate, when used with rustc, is supposed to output
// profile files (.profraw) after running a binary to analyze how the compiler
// optimizes code. This test checks that these files are generated.
// See https://github.com/rust-lang/rust/pull/48346
//@ needs-profiler-support
//@ ignore-cross-compile
use run_make_support::{cwd, find_files_by_prefix_and_extension, run, rustc};
fn main() {
rustc().arg("-g").profile_generate(cwd()).run();
run("test");
assert!(
find_files_by_prefix_and_extension(cwd(), "default", "profraw").len() > 0,
"no .profraw file generated"
);
}