]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/instrument_coverage.rs
Merge pull request #2 from rust-lang/master
[rust.git] / src / test / mir-opt / instrument_coverage.rs
1 // Test that the initial version of Rust coverage injects count_code_region() placeholder calls,
2 // at the top of each function. The placeholders are later converted into LLVM instrprof.increment
3 // intrinsics, during codegen.
4
5 // needs-profiler-support
6 // compile-flags: -Zinstrument-coverage
7 // EMIT_MIR rustc.main.InstrumentCoverage.diff
8 // EMIT_MIR rustc.bar.InstrumentCoverage.diff
9 fn main() {
10     loop {
11         if bar() {
12             break;
13         }
14     }
15 }
16
17 #[inline(never)]
18 fn bar() -> bool {
19     true
20 }