about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-10-12 20:40:03 +0200
committerRalf Jung <post@ralfj.de>2019-10-12 20:40:03 +0200
commit63af27f9ea81a71eb4ea9fb076228993f923cebb (patch)
tree17066b105cf2b3b0d24da365178c143c514dab6c /src/test/codegen
parenta1a8f33abbf5ee00e6918246f4525c6e4458225f (diff)
downloadrust-63af27f9ea81a71eb4ea9fb076228993f923cebb.tar.gz
rust-63af27f9ea81a71eb4ea9fb076228993f923cebb.zip
also (properly) test nounwind on function definitions
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/nounwind-extern.rs6
-rw-r--r--src/test/codegen/unwind-extern-exports.rs19
2 files changed, 19 insertions, 6 deletions
diff --git a/src/test/codegen/nounwind-extern.rs b/src/test/codegen/nounwind-extern.rs
deleted file mode 100644
index 54d6a8d2794..00000000000
--- a/src/test/codegen/nounwind-extern.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-// compile-flags: -O
-
-#![crate_type = "lib"]
-
-// CHECK: Function Attrs: norecurse nounwind
-pub extern fn foo() {}
diff --git a/src/test/codegen/unwind-extern-exports.rs b/src/test/codegen/unwind-extern-exports.rs
new file mode 100644
index 00000000000..e7aad9ac723
--- /dev/null
+++ b/src/test/codegen/unwind-extern-exports.rs
@@ -0,0 +1,19 @@
+// compile-flags: -C opt-level=0
+
+#![crate_type = "lib"]
+#![feature(unwind_attributes)]
+
+// Make sure these all do *not* get the attribute.
+// We disable optimizations to prevent LLVM from infering the attribute.
+// CHECK-NOT: nounwind
+
+// "C" ABI
+// pub extern fn foo() {} // FIXME right now we don't abort-on-panic but add `nounwind` nevertheless
+#[unwind(allowed)]
+pub extern fn foo_allowed() {}
+
+// "Rust" ABI (`extrn "Rust"` could be removed as all `fn` get it implicitly; we leave it
+// in for clarity.)
+pub extern "Rust" fn bar() {}
+#[unwind(allowed)]
+pub extern "Rust" fn bar_allowed() {}