rust/tests/coverage-map/status-quo/inline-dead.rs
Zalathar 3141177995 Copy most of tests/run-coverage into tests/coverage-map/status-quo
The output of these tests is too complicated to comfortably verify by hand, but
we can still use them to observe changes to the underlying mappings produced by
codegen/LLVM.

If these tests fail due to non-coverage changes (e.g. in HIR-to-MIR lowering or
MIR optimizations), it should usually be OK to just `--bless` them, as long as
the `run-coverage` test suite still works.
2023-09-05 11:55:34 +10:00

28 lines
378 B
Rust

// Regression test for issue #98833.
// compile-flags: -Zinline-mir -Cdebug-assertions=off
fn main() {
println!("{}", live::<false>());
let f = |x: bool| {
debug_assert!(
x
);
};
f(false);
}
#[inline]
fn live<const B: bool>() -> u32 {
if B {
dead()
} else {
0
}
}
#[inline]
fn dead() -> u32 {
42
}