FileCheck inline_diverging

This commit is contained in:
Ryan Mehri 2023-10-20 18:03:13 -07:00
parent 7ee05d24b5
commit d8f33ef93d

View File

@ -1,4 +1,3 @@
// skip-filecheck
// Tests inlining of diverging calls. // Tests inlining of diverging calls.
// //
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
@ -7,6 +6,8 @@
// EMIT_MIR inline_diverging.f.Inline.diff // EMIT_MIR inline_diverging.f.Inline.diff
pub fn f() { pub fn f() {
// CHECK-LABEL: fn f(
// CHECK: (inlined sleep)
sleep(); sleep();
} }
@ -15,12 +16,17 @@ pub fn g(i: i32) -> u32 {
if i > 0 { if i > 0 {
i as u32 i as u32
} else { } else {
// CHECK-LABEL: fn g(
// CHECK: (inlined panic)
panic(); panic();
} }
} }
// EMIT_MIR inline_diverging.h.Inline.diff // EMIT_MIR inline_diverging.h.Inline.diff
pub fn h() { pub fn h() {
// CHECK-LABEL: fn h(
// CHECK: (inlined call_twice::<!, fn() -> ! {sleep}>)
// CHECK-NOT: inlined
call_twice(sleep); call_twice(sleep);
} }