Files
rust/src/test/codegen/catch-unwind.rs

20 lines
274 B
Rust
Raw Normal View History

// compile-flags: -O
#![crate_type = "lib"]
extern "C" {
fn bar();
}
// CHECK-LABEL: @foo
#[no_mangle]
pub unsafe fn foo() -> i32 {
// CHECK: call void @bar
// CHECK: ret i32 0
std::panic::catch_unwind(|| {
bar();
0
})
.unwrap()
}