Skip to content

Commit eeb4fe0

Browse files
committed
rewrite profile to rmake
1 parent e56229e commit eeb4fe0

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ run-make/pretty-print-to-file/Makefile
138138
run-make/pretty-print-with-dep-file/Makefile
139139
run-make/print-calling-conventions/Makefile
140140
run-make/print-target-list/Makefile
141-
run-make/profile/Makefile
142141
run-make/prune-link-args/Makefile
143142
run-make/raw-dylib-alt-calling-convention/Makefile
144143
run-make/raw-dylib-c/Makefile

tests/run-make/profile/Makefile

-13
This file was deleted.

tests/run-make/profile/rmake.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
10+
use run_make_support::{run, rustc};
11+
use std::path::Path;
12+
13+
fn main() {
14+
rustc().arg("-g").arg("-Zprofile").input("test.rs").run();
15+
run("test");
16+
assert!(Path::new("test.gcno").exists(), "no .gcno file");
17+
assert!(Path::new("test.gcda").exists(), "no .gcda file");
18+
rustc().arg("-g").arg("-Zprofile").arg("-Zprofile-emit=abc/abc.gcda").input("test.rs").run();
19+
run("test");
20+
assert!(Path::new("abc/abc.gcda").exists(), "gcda file not emitted to defined path");
21+
}

0 commit comments

Comments
 (0)