rewrite pgo-gen-lto to rmake · rust-lang/rust@0149ba3 (original) (raw)
File tree
3 files changed
lines changed
- tests/run-make/pgo-gen-lto
3 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -20,7 +20,6 @@ run-make/min-global-align/Makefile | ||
20 | 20 | run-make/native-link-modifier-bundle/Makefile |
21 | 21 | run-make/no-alloc-shim/Makefile |
22 | 22 | run-make/pdb-buildinfo-cl-cmd/Makefile |
23 | -run-make/pgo-gen-lto/Makefile | |
24 | 23 | run-make/pgo-indirect-call-promotion/Makefile |
25 | 24 | run-make/raw-dylib-alt-calling-convention/Makefile |
26 | 25 | run-make/raw-dylib-c/Makefile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
1 | +// A simple smoke test: when rustc compiles with profiling enabled, a profraw file | |
2 | +// should be generated. | |
3 | +// See https://github.com/rust-lang/rust/pull/48346 | |
4 | + | |
5 | +//@ needs-profiler-support | |
6 | +// Reason: this exercises LTO profiling | |
7 | +//@ ignore-cross-compile | |
8 | +// Reason: the compiled binary is executed | |
9 | + | |
10 | +use run_make_support::{cwd, has_extension, has_prefix, run, rustc, shallow_find_files}; | |
11 | + | |
12 | +fn main() { | |
13 | +rustc().opt_level("3").arg("-Clto=fat").profile_generate(cwd()).input("test.rs").run(); | |
14 | +run("test"); | |
15 | +assert_eq!( | |
16 | + shallow_find_files(cwd(), |path | |
17 | + has_prefix(path, "default_") && has_extension(path, "profraw") | |
18 | +}) | |
19 | +.len(), | |
20 | +1 | |
21 | +); | |
22 | +} |