mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
rewrite pgo-gen to rmake
This commit is contained in:
parent
11dd90f761
commit
1e4d821136
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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)
|
18
tests/run-make/pgo-gen/rmake.rs
Normal file
18
tests/run-make/pgo-gen/rmake.rs
Normal 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"
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user