rust/tests/mir-opt/inline/inline_any_operand.rs

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

21 lines
374 B
Rust
Raw Normal View History

//@ compile-flags: -Z span_free_formats -C debuginfo=full
// Tests that MIR inliner works for any operand
fn main() {
println!("{}", bar());
}
2020-07-27 14:22:43 -05:00
// EMIT_MIR inline_any_operand.bar.Inline.after.mir
fn bar() -> bool {
2023-10-20 13:12:17 -05:00
// CHECK-LABEL: fn bar(
// CHECK: (inlined foo)
let f = foo;
f(1, -1)
}
2019-01-24 13:05:19 -06:00
#[inline(always)]
fn foo(x: i32, y: i32) -> bool {
x == y
}