about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop/terminator.rs
blob: aac5d11d3d4828f191b8c268539f4961ae5d5cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: 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);
}