2024-04-14 20:22:35 -05:00
|
|
|
//@ compile-flags: -Z span_free_formats -C debuginfo=full
|
2018-09-22 16:48:33 -05:00
|
|
|
|
|
|
|
// 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
|
2018-09-22 16:48:33 -05:00
|
|
|
fn bar() -> bool {
|
2023-10-20 13:12:17 -05:00
|
|
|
// CHECK-LABEL: fn bar(
|
|
|
|
// CHECK: (inlined foo)
|
2018-09-22 16:48:33 -05:00
|
|
|
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
|
|
|
|
}
|