about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-10-12 19:48:58 +0200
committerRalf Jung <post@ralfj.de>2019-10-12 20:39:27 +0200
commita1a8f33abbf5ee00e6918246f4525c6e4458225f (patch)
tree9132a558b88719a006ae3f067dba4ef171969d58
parent9a0b9c69600946c8c665705df2cec9ed7ce63d71 (diff)
downloadrust-a1a8f33abbf5ee00e6918246f4525c6e4458225f.tar.gz
rust-a1a8f33abbf5ee00e6918246f4525c6e4458225f.zip
update test for nounwind on FFI imports
-rw-r--r--src/test/codegen/extern-functions.rs19
-rw-r--r--src/test/codegen/unwind-extern-imports.rs41
2 files changed, 41 insertions, 19 deletions
diff --git a/src/test/codegen/extern-functions.rs b/src/test/codegen/extern-functions.rs
deleted file mode 100644
index a935d886522..00000000000
--- a/src/test/codegen/extern-functions.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// 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();
-}
-
-pub unsafe fn force_declare() {
-    extern_fn();
-    unwinding_extern_fn();
-}
diff --git a/src/test/codegen/unwind-extern-imports.rs b/src/test/codegen/unwind-extern-imports.rs
new file mode 100644
index 00000000000..1c79162536f
--- /dev/null
+++ b/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();
+}