]> git.proxmox.com Git - rustc.git/blame - src/test/codegen/unwind-extern-exports.rs
New upstream version 1.40.0+dfsg1
[rustc.git] / src / test / codegen / unwind-extern-exports.rs
CommitLineData
e74abb32
XL
1// compile-flags: -C opt-level=0
2// ignore-wasm32-bare compiled with panic=abort by default
3
4#![crate_type = "lib"]
5#![feature(unwind_attributes)]
6
7// Make sure these all do *not* get the attribute.
8// We disable optimizations to prevent LLVM from infering the attribute.
9// CHECK-NOT: nounwind
10
11// "C" ABI
12// pub extern fn foo() {} // FIXME right now we don't abort-on-panic but add `nounwind` nevertheless
13#[unwind(allowed)]
14pub extern fn foo_allowed() {}
15
16// "Rust"
17// (`extern "Rust"` could be removed as all `fn` get it implicitly; we leave it in for clarity.)
18pub extern "Rust" fn bar() {}
19#[unwind(allowed)]
20pub extern "Rust" fn bar_allowed() {}