mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
update test for nounwind on FFI imports
This commit is contained in:
parent
9a0b9c6960
commit
a1a8f33abb
@ -1,19 +0,0 @@
|
||||
// compile-flags: -C no-prepopulate-passes
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(unwind_attributes)]
|
||||
|
||||
extern {
|
||||
// CHECK: Function Attrs: nounwind
|
||||
// CHECK-NEXT: declare void @extern_fn
|
||||
fn extern_fn();
|
||||
// CHECK-NOT: Function Attrs: nounwind
|
||||
// CHECK: declare void @unwinding_extern_fn
|
||||
#[unwind(allowed)]
|
||||
fn unwinding_extern_fn();
|
||||
}
|
||||
|
||||
pub unsafe fn force_declare() {
|
||||
extern_fn();
|
||||
unwinding_extern_fn();
|
||||
}
|
41
src/test/codegen/unwind-extern-imports.rs
Normal file
41
src/test/codegen/unwind-extern-imports.rs
Normal file
@ -0,0 +1,41 @@
|
||||
// compile-flags: -C no-prepopulate-passes
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(unwind_attributes)]
|
||||
|
||||
extern {
|
||||
// CHECK: Function Attrs: nounwind
|
||||
// CHECK-NEXT: declare void @extern_fn
|
||||
fn extern_fn();
|
||||
// CHECK-NOT: Function Attrs: nounwind
|
||||
// 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user