]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/unwind-extern-exports.rs
Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=eddyb
[rust.git] / src / test / codegen / unwind-extern-exports.rs
1 // compile-flags: -C opt-level=0
2
3 #![crate_type = "lib"]
4 #![feature(unwind_attributes)]
5
6 // Make sure these all do *not* get the attribute.
7 // We disable optimizations to prevent LLVM from infering the attribute.
8 // CHECK-NOT: nounwind
9
10 // "C" ABI
11 // pub extern fn foo() {} // FIXME right now we don't abort-on-panic but add `nounwind` nevertheless
12 #[unwind(allowed)]
13 pub extern fn foo_allowed() {}
14
15 // "Rust"
16 // (`extern "Rust"` could be removed as all `fn` get it implicitly; we leave it in for clarity.)
17 pub extern "Rust" fn bar() {}
18 #[unwind(allowed)]
19 pub extern "Rust" fn bar_allowed() {}