]> git.lizzy.rs Git - rust.git/blob - tests/codegen/some-global-nonnull.rs
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
[rust.git] / tests / codegen / some-global-nonnull.rs
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]
9 pub fn test() {
10     test_inner(Some(inner0));
11 }
12
13 fn test_inner(f_maybe: Option<fn()>) {
14     if let Some(f) = f_maybe {
15         f();
16     }
17 }
18
19 fn inner0() {
20     unsafe { ext_fn0() };
21 }
22
23 extern "C" {
24     fn ext_fn0();
25 }