mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
84ac80f192
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
24 lines
941 B
Rust
24 lines
941 B
Rust
// This test revolves around the rustc flag -Z profile, which should
|
|
// generate a .gcno file (initial profiling information) as well
|
|
// as a .gcda file (branch counters). The path where these are emitted
|
|
// should also be configurable with -Z profile-emit. This test checks
|
|
// that the files are produced, and then that the latter flag is respected.
|
|
// See https://github.com/rust-lang/rust/pull/42433
|
|
|
|
//@ ignore-cross-compile
|
|
//@ needs-profiler-support
|
|
|
|
use std::path::Path;
|
|
|
|
use run_make_support::{run, rustc};
|
|
|
|
fn main() {
|
|
rustc().arg("-g").arg("-Zprofile").input("test.rs").run();
|
|
run("test");
|
|
assert!(Path::new("test.gcno").exists(), "no .gcno file");
|
|
assert!(Path::new("test.gcda").exists(), "no .gcda file");
|
|
rustc().arg("-g").arg("-Zprofile").arg("-Zprofile-emit=abc/abc.gcda").input("test.rs").run();
|
|
run("test");
|
|
assert!(Path::new("abc/abc.gcda").exists(), "gcda file not emitted to defined path");
|
|
}
|