summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/inline/inline_any_operand.rs
blob: 659b7c3a0a1f5c30aa4ff19b30f33dbc29257e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// compile-flags: -Z span_free_formats

// Tests that MIR inliner works for any operand

fn main() {
    println!("{}", bar());
}

// EMIT_MIR inline_any_operand.bar.Inline.after.mir
fn bar() -> bool {
    // CHECK-LABEL: fn bar(
    // CHECK: (inlined foo)
    let f = foo;
    f(1, -1)
}

#[inline(always)]
fn foo(x: i32, y: i32) -> bool {
    x == y
}