]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/catch-unwind.rs
Auto merge of #69778 - Marwes:dep_graph, r=davidtwco
[rust.git] / src / test / codegen / catch-unwind.rs
1 // compile-flags: -O
2
3 #![crate_type = "lib"]
4
5 extern "C" {
6     fn bar();
7 }
8
9 // CHECK-LABEL: @foo
10 #[no_mangle]
11 pub unsafe fn foo() -> i32 {
12     // CHECK: call void @bar
13     // CHECK: ret i32 0
14     std::panic::catch_unwind(|| {
15         bar();
16         0
17     })
18     .unwrap()
19 }