Skip to content

Commit

Permalink
update test for nounwind on FFI imports
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Oct 12, 2019
1 parent 9a0b9c6 commit a1a8f33
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/test/codegen/extern-functions.rs

This file was deleted.

41 changes: 41 additions & 0 deletions src/test/codegen/unwind-extern-imports.rs
@@ -0,0 +1,41 @@
// compile-flags: -C no-prepopulate-passes

#![crate_type = "lib"]
#![feature(unwind_attributes)]

extern {
// CHECK: Function Attrs: nounwind
// CHECK-NEXT: declare void @extern_fn
fn extern_fn();
// CHECK-NOT: Function Attrs: nounwind
// CHECK: declare void @unwinding_extern_fn
#[unwind(allowed)]
fn unwinding_extern_fn();
// CHECK-NOT: nounwind
// CHECK: declare void @aborting_extern_fn
#[unwind(aborts)]
fn aborting_extern_fn(); // FIXME: we want to have the attribute here
}

extern "Rust" {
// CHECK-NOT: nounwind
// CHECK: declare void @rust_extern_fn
fn rust_extern_fn();
// CHECK-NOT: nounwind
// CHECK: declare void @rust_unwinding_extern_fn
#[unwind(allowed)]
fn rust_unwinding_extern_fn();
// CHECK-NOT: nounwind
// CHECK: declare void @rust_aborting_extern_fn
#[unwind(aborts)]
fn rust_aborting_extern_fn(); // FIXME: we want to have the attribute here
}

pub unsafe fn force_declare() {
extern_fn();
unwinding_extern_fn();
aborting_extern_fn();
rust_extern_fn();
rust_unwinding_extern_fn();
rust_aborting_extern_fn();
}

0 comments on commit a1a8f33

Please sign in to comment.