]> git.proxmox.com Git - rustc.git/blob - src/test/codegen/catch-unwind.rs
New upstream version 1.44.1+dfsg1
[rustc.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 }