diff options
Diffstat (limited to 'tests/mir-opt/inline/inline_any_operand.rs')
-rw-r--r-- | tests/mir-opt/inline/inline_any_operand.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/mir-opt/inline/inline_any_operand.rs b/tests/mir-opt/inline/inline_any_operand.rs new file mode 100644 index 000000000..fb0de020f --- /dev/null +++ b/tests/mir-opt/inline/inline_any_operand.rs @@ -0,0 +1,18 @@ +// 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 { + let f = foo; + f(1, -1) +} + +#[inline(always)] +fn foo(x: i32, y: i32) -> bool { + x == y +} |