2019-10-12 12:48:58 -05:00
|
|
|
// compile-flags: -C no-prepopulate-passes
|
2019-10-18 16:47:54 -05:00
|
|
|
// ignore-wasm32-bare compiled with panic=abort by default
|
2023-05-23 08:20:57 -05:00
|
|
|
// needs-unwind
|
2019-10-12 12:48:58 -05:00
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
2021-06-08 13:23:58 -05:00
|
|
|
#![feature(c_unwind)]
|
2019-10-12 12:48:58 -05:00
|
|
|
|
2020-09-01 16:12:52 -05:00
|
|
|
extern "C" {
|
2021-06-08 13:23:58 -05:00
|
|
|
// CHECK: Function Attrs:{{.*}}nounwind
|
|
|
|
// CHECK-NEXT: declare{{.*}}void @extern_fn
|
2019-10-12 12:48:58 -05:00
|
|
|
fn extern_fn();
|
|
|
|
}
|
|
|
|
|
2021-06-08 13:23:58 -05:00
|
|
|
extern "C-unwind" {
|
|
|
|
// CHECK-NOT: nounwind
|
|
|
|
// CHECK: declare{{.*}}void @c_unwind_extern_fn
|
|
|
|
fn c_unwind_extern_fn();
|
2019-10-12 12:48:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
pub unsafe fn force_declare() {
|
|
|
|
extern_fn();
|
2021-06-08 13:23:58 -05:00
|
|
|
c_unwind_extern_fn();
|
2019-10-12 12:48:58 -05:00
|
|
|
}
|