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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
718 B
Rust
Raw Normal View History

2024-06-25 12:22:02 -05:00
// -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-runtime
2024-06-25 12:22:02 -05:00
//@ ignore-cross-compile
use run_make_support::{cwd, has_extension, has_prefix, run, rustc, shallow_find_files};
2024-06-25 12:22:02 -05:00
fn main() {
rustc().arg("-g").profile_generate(cwd()).input("test.rs").run();
2024-06-25 12:22:02 -05:00
run("test");
let profraw_files = shallow_find_files(cwd(), |path| {
has_prefix(path, "default") && has_extension(path, "profraw")
});
assert!(!profraw_files.is_empty(), "no .profraw file generated");
2024-06-25 12:22:02 -05:00
}