Skip to content

Commit b15e72a

Browse files
committed
rewrite profile to rmake
1 parent a1555eb commit b15e72a

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ run-make/pgo-indirect-call-promotion/Makefile
113113
run-make/pointer-auth-link-with-c/Makefile
114114
run-make/print-calling-conventions/Makefile
115115
run-make/print-target-list/Makefile
116-
run-make/profile/Makefile
117116
run-make/prune-link-args/Makefile
118117
run-make/raw-dylib-alt-calling-convention/Makefile
119118
run-make/raw-dylib-c/Makefile

tests/run-make/profile/Makefile

-13
This file was deleted.

tests/run-make/profile/rmake.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This test revolves around the rustc flag -Z profile, which should
2+
// generate a .gcno file (initial profiling information) as well
3+
// as a .gcda file (branch counters). The path where these are emitted
4+
// should also be configurable with -Z profile-emit. This test checks
5+
// that the files are produced, and then that the latter flag is respected.
6+
// See https://github.com/rust-lang/rust/pull/42433
7+
8+
//@ ignore-cross-compile
9+
//@ needs-profiler-support
10+
11+
use run_make_support::{run, rustc};
12+
use std::path::Path;
13+
14+
fn main() {
15+
rustc().arg("-g").arg("-Zprofile").input("test.rs").run();
16+
run("test");
17+
assert!(Path::new("test.gcno").exists(), "no .gcno file");
18+
assert!(Path::new("test.gcda").exists(), "no .gcda file");
19+
rustc().arg("-g").arg("-Zprofile").arg("-Zprofile-emit=abc/abc.gcda").input("test.rs").run();
20+
run("test");
21+
assert!(Path::new("abc/abc.gcda").exists(), "gcda file not emitted to defined path");
22+
}

0 commit comments

Comments
 (0)