rust/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
313 B
Rust
Raw Normal View History

2022-10-06 18:11:06 -05:00
// unit-test: DataflowConstProp
#[inline(never)]
fn escape<T>(x: &T) {}
2022-10-06 18:17:43 -05:00
#[inline(never)]
fn some_function() {}
2022-10-06 18:11:06 -05:00
// EMIT_MIR ref_without_sb.main.DataflowConstProp.diff
fn main() {
let mut a = 0;
escape(&a);
a = 1;
2022-10-06 18:17:43 -05:00
some_function();
// This should currently not be propagated.
2022-10-06 18:11:06 -05:00
let b = a;
}