]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/unwind-extern-imports.rs
Rollup merge of #69800 - tmiasko:address-g, r=nikic
[rust.git] / src / test / codegen / unwind-extern-imports.rs
1 // compile-flags: -C no-prepopulate-passes
2 // ignore-wasm32-bare compiled with panic=abort by default
3
4 #![crate_type = "lib"]
5 #![feature(unwind_attributes)]
6
7 extern {
8 // CHECK: Function Attrs:{{.*}}nounwind
9 // CHECK-NEXT: declare void @extern_fn
10     fn extern_fn();
11 // CHECK-NOT: Function Attrs:{{.*}}nounwind
12 // CHECK: declare void @unwinding_extern_fn
13     #[unwind(allowed)]
14     fn unwinding_extern_fn();
15 // CHECK-NOT: nounwind
16 // CHECK: declare void @aborting_extern_fn
17     #[unwind(aborts)]
18     fn aborting_extern_fn(); // FIXME: we want to have the attribute here
19 }
20
21 extern "Rust" {
22 // CHECK-NOT: nounwind
23 // CHECK: declare void @rust_extern_fn
24     fn rust_extern_fn();
25 // CHECK-NOT: nounwind
26 // CHECK: declare void @rust_unwinding_extern_fn
27     #[unwind(allowed)]
28     fn rust_unwinding_extern_fn();
29 // CHECK-NOT: nounwind
30 // CHECK: declare void @rust_aborting_extern_fn
31     #[unwind(aborts)]
32     fn rust_aborting_extern_fn(); // FIXME: we want to have the attribute here
33 }
34
35 pub unsafe fn force_declare() {
36     extern_fn();
37     unwinding_extern_fn();
38     aborting_extern_fn();
39     rust_extern_fn();
40     rust_unwinding_extern_fn();
41     rust_aborting_extern_fn();
42 }