]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/unwind-extern-imports.rs
Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=eddyb
[rust.git] / src / test / codegen / unwind-extern-imports.rs
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 }