mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
also (properly) test nounwind on function definitions
This commit is contained in:
parent
a1a8f33abb
commit
63af27f9ea
@ -1,6 +0,0 @@
|
||||
// compile-flags: -O
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK: Function Attrs: norecurse nounwind
|
||||
pub extern fn foo() {}
|
19
src/test/codegen/unwind-extern-exports.rs
Normal file
19
src/test/codegen/unwind-extern-exports.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// compile-flags: -C opt-level=0
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(unwind_attributes)]
|
||||
|
||||
// Make sure these all do *not* get the attribute.
|
||||
// We disable optimizations to prevent LLVM from infering the attribute.
|
||||
// CHECK-NOT: nounwind
|
||||
|
||||
// "C" ABI
|
||||
// pub extern fn foo() {} // FIXME right now we don't abort-on-panic but add `nounwind` nevertheless
|
||||
#[unwind(allowed)]
|
||||
pub extern fn foo_allowed() {}
|
||||
|
||||
// "Rust" ABI (`extrn "Rust"` could be removed as all `fn` get it implicitly; we leave it
|
||||
// in for clarity.)
|
||||
pub extern "Rust" fn bar() {}
|
||||
#[unwind(allowed)]
|
||||
pub extern "Rust" fn bar_allowed() {}
|
Loading…
Reference in New Issue
Block a user