about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop/terminator.rs
blob: 4472861f132dbdbbebf90c3f960bcd011eb7fea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp

fn foo(n: i32) {}

// EMIT_MIR terminator.main.DataflowConstProp.diff

// CHECK-LABEL: fn main(
fn main() {
    let a = 1;
    // Checks that we propagate into terminators.
    // CHECK: {{_.*}} = foo(const 2_i32) -> [return: {{bb.*}}, unwind
    foo(a + 1);
}