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
|
2019-10-12 19:48:58 +02:00
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(unwind_attributes)]
|
|
|
|
|
|
|
|
extern {
|
2019-10-12 23:08:57 +02:00
|
|
|
// CHECK: Function Attrs:{{.*}}nounwind
|
2019-10-12 19:48:58 +02:00
|
|
|
// CHECK-NEXT: declare void @extern_fn
|
|
|
|
fn extern_fn();
|
2019-10-12 23:08:57 +02:00
|
|
|
// CHECK-NOT: Function Attrs:{{.*}}nounwind
|
2019-10-12 19:48:58 +02:00
|
|
|
// CHECK: declare void @unwinding_extern_fn
|
|
|
|
#[unwind(allowed)]
|
|
|
|
fn unwinding_extern_fn();
|
|
|
|
// CHECK-NOT: nounwind
|
|
|
|
// CHECK: declare void @aborting_extern_fn
|
|
|
|
#[unwind(aborts)]
|
|
|
|
fn aborting_extern_fn(); // FIXME: we want to have the attribute here
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "Rust" {
|
|
|
|
// CHECK-NOT: nounwind
|
|
|
|
// CHECK: declare void @rust_extern_fn
|
|
|
|
fn rust_extern_fn();
|
|
|
|
// CHECK-NOT: nounwind
|
|
|
|
// CHECK: declare void @rust_unwinding_extern_fn
|
|
|
|
#[unwind(allowed)]
|
|
|
|
fn rust_unwinding_extern_fn();
|
|
|
|
// CHECK-NOT: nounwind
|
|
|
|
// CHECK: declare void @rust_aborting_extern_fn
|
|
|
|
#[unwind(aborts)]
|
|
|
|
fn rust_aborting_extern_fn(); // FIXME: we want to have the attribute here
|
|
|
|
}
|
|
|
|
|
|
|
|
pub unsafe fn force_declare() {
|
|
|
|
extern_fn();
|
|
|
|
unwinding_extern_fn();
|
|
|
|
aborting_extern_fn();
|
|
|
|
rust_extern_fn();
|
|
|
|
rust_unwinding_extern_fn();
|
|
|
|
rust_aborting_extern_fn();
|
|
|
|
}
|