2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-04-14 20:22:35 -05:00
|
|
|
//@ compile-flags: -Zinline-mir-hint-threshold=1000 -C debuginfo=full
|
2021-01-25 03:34:33 -06:00
|
|
|
|
2021-01-23 07:49:20 -06:00
|
|
|
// EMIT_MIR cycle.f.Inline.diff
|
2020-12-29 10:21:52 -06:00
|
|
|
#[inline(always)]
|
|
|
|
fn f(g: impl Fn()) {
|
2023-10-20 13:11:22 -05:00
|
|
|
// CHECK-LABEL: fn f(
|
|
|
|
// CHECK-NOT: inlined
|
2020-12-29 10:21:52 -06:00
|
|
|
g();
|
|
|
|
}
|
|
|
|
|
2021-01-23 07:49:20 -06:00
|
|
|
// EMIT_MIR cycle.g.Inline.diff
|
2020-12-29 10:21:52 -06:00
|
|
|
#[inline(always)]
|
|
|
|
fn g() {
|
2023-10-20 13:11:22 -05:00
|
|
|
// CHECK-LABEL: fn g(
|
2024-01-07 16:53:20 -06:00
|
|
|
// CHECK-NOT: (inlined f::<fn() {main}>)
|
2020-12-29 10:21:52 -06:00
|
|
|
f(main);
|
|
|
|
}
|
|
|
|
|
2021-01-23 07:49:20 -06:00
|
|
|
// EMIT_MIR cycle.main.Inline.diff
|
2020-12-29 10:21:52 -06:00
|
|
|
fn main() {
|
2023-10-20 13:11:22 -05:00
|
|
|
// CHECK-LABEL: fn main(
|
2023-10-22 11:27:43 -05:00
|
|
|
// CHECK-NOT: inlined
|
2023-10-20 13:11:22 -05:00
|
|
|
// CHECK: (inlined f::<fn() {g}>)
|
|
|
|
// CHECK-NOT: inlined
|
2020-12-29 10:21:52 -06:00
|
|
|
f(g);
|
|
|
|
}
|