]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/coverage_graphviz.rs
Rollup merge of #107596 - Kobzol:stage-build-timer, r=Mark-Simulacrum
[rust.git] / tests / mir-opt / coverage_graphviz.rs
1 // Test that `-C instrument-coverage` with `-Z dump-mir-graphviz` generates a graphviz (.dot file)
2 // rendering of the `BasicCoverageBlock` coverage control flow graph, with counters and
3 // expressions.
4
5 // needs-profiler-support
6 // compile-flags: -C instrument-coverage -Z dump-mir-graphviz
7 // EMIT_MIR coverage_graphviz.main.InstrumentCoverage.0.dot
8 // EMIT_MIR coverage_graphviz.bar.InstrumentCoverage.0.dot
9 fn main() {
10     loop {
11         if bar() {
12             break;
13         }
14     }
15 }
16
17 #[inline(never)]
18 fn bar() -> bool {
19     true
20 }