]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/instrument_coverage.rs
added test, Operand::const_from_scalar, require_lang_item, & comments
[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 // compile-flags: -Zinstrument-coverage
6 // EMIT_MIR rustc.main.InstrumentCoverage.diff
7 // EMIT_MIR rustc.bar.InstrumentCoverage.diff
8 fn main() {
9     loop {
10         if bar() {
11             break;
12         }
13     }
14 }
15
16 #[inline(never)]
17 fn bar() -> bool {
18     true
19 }