Skip to content

Commit 63af27f

Browse files
committed
also (properly) test nounwind on function definitions
1 parent a1a8f33 commit 63af27f

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/test/codegen/nounwind-extern.rs

-6
This file was deleted.
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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" ABI (`extrn "Rust"` could be removed as all `fn` get it implicitly; we leave it
16+
// in for clarity.)
17+
pub extern "Rust" fn bar() {}
18+
#[unwind(allowed)]
19+
pub extern "Rust" fn bar_allowed() {}

0 commit comments

Comments
 (0)