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