1 // compile-flags: -O 2 3 #![crate_type = "lib"] 4 5 // CHECK-LABEL: @test 6 // CHECK-NEXT: start: 7 // CHECK-NEXT: tail call void @ext_fn0() 8 #[no_mangle] test()9pub fn test() { 10 test_inner(Some(inner0)); 11 } 12 test_inner(f_maybe: Option<fn()>)13fn test_inner(f_maybe: Option<fn()>) { 14 if let Some(f) = f_maybe { 15 f(); 16 } 17 } 18 inner0()19fn inner0() { 20 unsafe { ext_fn0() }; 21 } 22 23 extern "C" { ext_fn0()24 fn ext_fn0(); 25 } 26