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

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

15 lines
335 B
Rust
Raw Normal View History

// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: DataflowConstProp
fn foo(n: i32) {}
// EMIT_MIR terminator.main.DataflowConstProp.diff
2024-01-12 07:22:33 +00:00
// CHECK-LABEL: fn main(
fn main() {
let a = 1;
// Checks that we propagate into terminators.
2024-01-29 06:44:32 +00:00
// CHECK: {{_.*}} = foo(const 2_i32) -> [return: {{bb.*}}, unwind
foo(a + 1);
}