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

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

23 lines
686 B
Rust
Raw Normal View History

2024-08-06 15:35:08 -05:00
// A simple smoke test: when rustc compiles with profiling enabled, a profraw file
// should be generated.
// See https://github.com/rust-lang/rust/pull/48346
//@ needs-profiler-support
// Reason: this exercises LTO profiling
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{cwd, has_extension, has_prefix, run, rustc, shallow_find_files};
fn main() {
rustc().opt_level("3").arg("-Clto=fat").profile_generate(cwd()).input("test.rs").run();
run("test");
assert_eq!(
shallow_find_files(cwd(), |path| {
has_prefix(path, "default_") && has_extension(path, "profraw")
})
.len(),
1
);
}