summary refs log tree commit diff
path: root/src/test/mir-opt/instrument_coverage.rs
blob: 3fe010ef68fc351abe2709c2560fdcb5ddf5e3c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Test that the initial version of Rust coverage injects count_code_region() placeholder calls,
// at the top of each function. The placeholders are later converted into LLVM instrprof.increment
// intrinsics, during codegen.

// needs-profiler-support
// compile-flags: -Zinstrument-coverage
// EMIT_MIR rustc.main.InstrumentCoverage.diff
// EMIT_MIR rustc.bar.InstrumentCoverage.diff
fn main() {
    loop {
        if bar() {
            break;
        }
    }
}

#[inline(never)]
fn bar() -> bool {
    true
}