Skip to content

Commit

Permalink
also (properly) test nounwind on function definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Oct 12, 2019
1 parent a1a8f33 commit 63af27f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/test/codegen/nounwind-extern.rs

This file was deleted.

19 changes: 19 additions & 0 deletions src/test/codegen/unwind-extern-exports.rs
@@ -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() {}

0 comments on commit 63af27f

Please sign in to comment.