about summary refs log tree commit diff
path: root/tests/run-make/pgo-gen/rmake.rs
blob: 5cd5a4583edafa66a4a6d04ed7609ab891bd8446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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-runtime
//@ ignore-cross-compile

use run_make_support::{cwd, has_extension, has_prefix, run, rustc, shallow_find_files};

fn main() {
    rustc().arg("-g").profile_generate(cwd()).input("test.rs").run();
    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");
}