Skip to content

Commit a1a8f33

Browse files
committed
update test for nounwind on FFI imports
1 parent 9a0b9c6 commit a1a8f33

File tree

2 files changed

+41
-19
lines changed

2 files changed

+41
-19
lines changed

src/test/codegen/extern-functions.rs

-19
This file was deleted.
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// compile-flags: -C no-prepopulate-passes
2+
3+
#![crate_type = "lib"]
4+
#![feature(unwind_attributes)]
5+
6+
extern {
7+
// CHECK: Function Attrs: nounwind
8+
// CHECK-NEXT: declare void @extern_fn
9+
fn extern_fn();
10+
// CHECK-NOT: Function Attrs: nounwind
11+
// CHECK: declare void @unwinding_extern_fn
12+
#[unwind(allowed)]
13+
fn unwinding_extern_fn();
14+
// CHECK-NOT: nounwind
15+
// CHECK: declare void @aborting_extern_fn
16+
#[unwind(aborts)]
17+
fn aborting_extern_fn(); // FIXME: we want to have the attribute here
18+
}
19+
20+
extern "Rust" {
21+
// CHECK-NOT: nounwind
22+
// CHECK: declare void @rust_extern_fn
23+
fn rust_extern_fn();
24+
// CHECK-NOT: nounwind
25+
// CHECK: declare void @rust_unwinding_extern_fn
26+
#[unwind(allowed)]
27+
fn rust_unwinding_extern_fn();
28+
// CHECK-NOT: nounwind
29+
// CHECK: declare void @rust_aborting_extern_fn
30+
#[unwind(aborts)]
31+
fn rust_aborting_extern_fn(); // FIXME: we want to have the attribute here
32+
}
33+
34+
pub unsafe fn force_declare() {
35+
extern_fn();
36+
unwinding_extern_fn();
37+
aborting_extern_fn();
38+
rust_extern_fn();
39+
rust_unwinding_extern_fn();
40+
rust_aborting_extern_fn();
41+
}

0 commit comments

Comments
 (0)